{
  "openapi": "3.1.0",
  "info": {
    "title": "AFMR Discovery API",
    "version": "1.0.0",
    "description": "Read-only MCP and A2A discovery for AFMR 1.0. AFMR records are scoped and are not universal safety claims.",
    "contact": {
      "url": "https://afmr.ai/"
    },
    "license": {
      "name": "CC BY 4.0",
      "url": "https://creativecommons.org/licenses/by/4.0/"
    }
  },
  "servers": [
    {
      "url": "https://afmr.ai"
    }
  ],
  "paths": {
    "/api/rpc": {
      "post": {
        "operationId": "mcpJsonRpc",
        "summary": "Call the public read-only AFMR MCP server",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonRpcRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonRpcResponse"
                }
              }
            }
          },
          "202": {
            "description": "Notification accepted"
          }
        }
      }
    },
    "/a2a": {
      "post": {
        "operationId": "a2aSendMessage",
        "summary": "Send a read-only discovery message to the AFMR A2A agent",
        "parameters": [
          {
            "name": "A2A-Version",
            "in": "header",
            "schema": {
              "type": "string",
              "const": "1.0"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonRpcRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A2A SendMessage response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonRpcResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "JsonRpcRequest": {
        "type": "object",
        "required": [
          "jsonrpc",
          "id",
          "method"
        ],
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "method": {
            "type": "string"
          },
          "params": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "JsonRpcResponse": {
        "type": "object",
        "required": [
          "jsonrpc",
          "id"
        ],
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {},
          "result": {},
          "error": {
            "type": "object"
          }
        }
      }
    }
  }
}
