{
  "openapi": "3.1.0",
  "info": {
    "title": "Nodi public agent APIs",
    "version": "1.0.0",
    "summary": "Read-only MCP and A2A endpoints from Nodi AI (usenodi.com).",
    "description": "Two public, read-only JSON-RPC 2.0 endpoints for AI agents, with the same six tools: UAE VAT, WhatsApp click-to-chat links, order profit with cash on delivery, WhatsApp Business API costs, Nodi's plans and prices, and guides for online sellers. No sign-in or API key. Docs: https://www.usenodi.com/agents.md",
    "contact": { "name": "Nodi AI", "url": "https://www.usenodi.com/contact-us", "email": "hello@usenodi.com" }
  },
  "externalDocs": { "description": "How to use the agent APIs", "url": "https://www.usenodi.com/agents.md" },
  "servers": [{ "url": "https://www.usenodi.com" }],
  "security": [],
  "paths": {
    "/mcp": {
      "post": {
        "operationId": "mcp",
        "summary": "Model Context Protocol (Streamable HTTP, stateless)",
        "description": "Send MCP JSON-RPC messages: initialize, tools/list, tools/call. Responses are JSON (no SSE stream, no session). Server card: https://www.usenodi.com/.well-known/mcp/server-card.json",
        "externalDocs": { "url": "https://modelcontextprotocol.io/specification" },
        "parameters": [
          { "name": "Accept", "in": "header", "required": true, "schema": { "type": "string", "example": "application/json, text/event-stream" } }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/JsonRpcRequest" },
              "example": { "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "calculate_uae_vat", "arguments": { "amount": 199, "mode": "remove" } } }
            }
          }
        },
        "responses": {
          "200": { "description": "JSON-RPC response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/JsonRpcResponse" } } } },
          "405": { "description": "Only POST is supported" }
        }
      }
    },
    "/a2a": {
      "post": {
        "operationId": "a2a",
        "summary": "Agent2Agent protocol v1.0 (JSON-RPC binding)",
        "description": "SendMessage with a data part {\"skill\": \"<id>\", \"arguments\": {...}} runs a skill; a text part returns matching guides. Answers come back immediately as a Message. Agent card: https://www.usenodi.com/.well-known/agent-card.json",
        "externalDocs": { "url": "https://a2a-protocol.org/latest/specification/" },
        "parameters": [
          { "name": "A2A-Version", "in": "header", "required": false, "schema": { "type": "string", "enum": ["1.0"] } }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/JsonRpcRequest" },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "SendMessage",
                "params": { "message": { "messageId": "1", "role": "ROLE_USER", "parts": [{ "data": { "skill": "nodi_pricing", "arguments": { "currency": "AED" } } }] } }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "JSON-RPC response (result.message, or error)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/JsonRpcResponse" } } } },
          "405": { "description": "Only POST is supported" }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "JsonRpcRequest": {
        "type": "object",
        "required": ["jsonrpc", "method"],
        "properties": {
          "jsonrpc": { "const": "2.0" },
          "id": { "type": ["string", "integer", "null"] },
          "method": { "type": "string" },
          "params": { "type": "object" }
        }
      },
      "JsonRpcResponse": {
        "type": "object",
        "required": ["jsonrpc", "id"],
        "properties": {
          "jsonrpc": { "const": "2.0" },
          "id": { "type": ["string", "integer", "null"] },
          "result": {},
          "error": {
            "type": "object",
            "properties": { "code": { "type": "integer" }, "message": { "type": "string" } }
          }
        }
      }
    }
  }
}
