{
  "openapi": "3.0.3",
  "info": {
    "title": "Chattoo MCP",
    "version": "0.1.0",
    "description": "Transporte MCP Streamable HTTP. Authorization usa token de projeto. Este contrato descreve HTTP; fluxos persistentes e interação MCP completa exigem um cliente MCP."
  },
  "servers": [
    {
      "url": "https://apis.chattoo.com.br"
    }
  ],
  "security": [
    {
      "ProjectToken": []
    }
  ],
  "components": {
    "securitySchemes": {
      "ProjectToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Chattoo project key"
      }
    }
  },
  "paths": {
    "/mcp": {
      "post": {
        "operationId": "mcpRpc",
        "summary": "Enviar uma solicitação MCP JSON-RPC",
        "parameters": [
          {
            "in": "header",
            "name": "MCP-Protocol-Version",
            "required": true,
            "schema": {
              "type": "string",
              "default": "2026-07-28"
            }
          },
          {
            "in": "header",
            "name": "Mcp-Method",
            "required": true,
            "schema": {
              "type": "string",
              "default": "tools/list"
            }
          },
          {
            "in": "header",
            "name": "Mcp-Name",
            "description": "Obrigatório em tools/call e resources/read; o Swagger preenche a partir do corpo.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jsonrpc",
                  "id",
                  "method",
                  "params"
                ],
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "enum": [
                      "2.0"
                    ]
                  },
                  "id": {
                    "type": "integer",
                    "example": 1
                  },
                  "method": {
                    "type": "string",
                    "example": "tools/list"
                  },
                  "params": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/list",
                "params": {
                  "_meta": {
                    "io.modelcontextprotocol/protocolVersion": "2026-07-28",
                    "io.modelcontextprotocol/clientInfo": {
                      "name": "chattoo-swagger",
                      "version": "1.0.0"
                    },
                    "io.modelcontextprotocol/clientCapabilities": {}
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Resposta JSON-RPC. SSE pode transportar progresso ou notificações.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "jsonrpc"
                  ],
                  "properties": {
                    "jsonrpc": {
                      "type": "string",
                      "enum": [
                        "2.0"
                      ]
                    },
                    "id": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "result": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                },
                "example": "event: message\ndata: {\"jsonrpc\":\"2.0\",\"id\":1,\"result\":{}}\n\n"
              }
            }
          },
          "202": {
            "description": "Notificação aceita, sem corpo."
          },
          "400": {
            "description": "Envelope, cabeçalho ou versão inválidos."
          },
          "401": {
            "description": "Token de projeto ausente, expirado ou revogado."
          },
          "403": {
            "description": "Origem ou escopo não autorizado."
          },
          "404": {
            "description": "Método ou recurso não disponível."
          },
          "413": {
            "description": "Corpo excede 64 KiB."
          },
          "415": {
            "description": "Use application/json."
          },
          "429": {
            "description": "Limite temporário; respeite Retry-After."
          },
          "503": {
            "description": "Serviço temporariamente indisponível."
          }
        }
      }
    }
  }
}
