{
  "openapi": "3.1.0",
  "info": {
    "title": "Myagi Public API",
    "summary": "Public HTTP surfaces for the Myagi platform.",
    "description": "Includes the contact endpoint, MCP server discovery, and proxies to the Open Agent Registry scanner.",
    "version": "0.1.0",
    "contact": {
      "name": "Myagi",
      "email": "contact@myagi.bot",
      "url": "https://myagi.bot"
    },
    "license": {
      "name": "Myagi Public Content License",
      "url": "https://myagi.bot/.well-known/rsl.xml"
    }
  },
  "servers": [
    {
      "url": "https://myagi.bot",
      "description": "Production"
    }
  ],
  "paths": {
    "/api/contact": {
      "post": {
        "operationId": "submit_contact",
        "summary": "Submit a contact inquiry.",
        "description": "Accepts a contact request. Forwards to contact@myagi.bot. Same behavior as the MCP submit_inquiry tool.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "email",
                  "message"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 200
                  },
                  "message": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 5000
                  },
                  "source": {
                    "type": "string",
                    "description": "Optional. Where the submission came from (homepage_form, mcp_tool, etc).",
                    "maxLength": 80
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Submission accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body."
          },
          "429": {
            "description": "Rate limit exceeded."
          }
        }
      }
    },
    "/api/mcp": {
      "get": {
        "operationId": "mcp_discovery",
        "summary": "MCP server endpoint discovery.",
        "description": "Returns the MCP transport metadata. The same path accepts POST for JSON-RPC 2.0 MCP protocol messages.",
        "responses": {
          "200": {
            "description": "MCP transport metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "mcp_jsonrpc",
        "summary": "MCP JSON-RPC 2.0 endpoint.",
        "description": "Implements the Model Context Protocol over streamable HTTP. Exposes tools: query_platform, submit_inquiry, registry_lookup.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jsonrpc",
                  "method",
                  "id"
                ],
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "const": "2.0"
                  },
                  "method": {
                    "type": "string"
                  },
                  "params": {
                    "type": "object"
                  },
                  "id": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "number"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/agent-card.json": {
      "get": {
        "operationId": "get_agent_card",
        "summary": "A2A agent card.",
        "responses": {
          "200": {
            "description": "Agent card document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/oauth-authorization-server": {
      "get": {
        "operationId": "get_oauth_metadata",
        "summary": "OAuth 2.0 authorization server metadata (RFC 8414).",
        "responses": {
          "200": {
            "description": "OAuth discovery document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/rsl.xml": {
      "get": {
        "operationId": "get_rsl_manifest",
        "summary": "Really Simple Licensing manifest.",
        "responses": {
          "200": {
            "description": "RSL XML manifest.",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "none": {
        "type": "http",
        "scheme": "noauth",
        "description": "Public endpoints require no authentication."
      },
      "oauth2": {
        "type": "oauth2",
        "description": "OAuth 2.0 (discovery only as of 0.1.0).",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://myagi.bot/oauth/authorize",
            "tokenUrl": "https://myagi.bot/oauth/token",
            "scopes": {
              "read:platform": "Read platform info.",
              "write:inquiry": "Submit inquiries.",
              "read:registry": "Read Open Agent Registry data."
            }
          }
        }
      }
    }
  },
  "x-mcp": {
    "transport": "streamable-http",
    "url": "https://myagi.bot/api/mcp",
    "tools": [
      "query_platform",
      "submit_inquiry",
      "registry_lookup"
    ]
  }
}