{
  "openapi": "3.1.0",
  "info": {
    "title": "Commerce for Agents MCP endpoint",
    "version": "0.1.0",
    "summary": "Model Context Protocol server for comparing and switching electricity and gas contracts in Germany, and comparing US fixed broadband providers.",
    "description": "The endpoint speaks the Model Context Protocol (Streamable HTTP transport, JSON-RPC 2.0 envelope). Use an MCP client rather than calling it by hand. The tools are compare-tariffs, tariff-details, book-contract and compare-broadband. Usage notes for agents: https://commerceforagents.com/llms.txt",
    "termsOfService": "https://commerceforagents.com/terms",
    "contact": { "name": "Yavio GmbH", "email": "contact@commerceforagents.com", "url": "https://commerceforagents.com/" }
  },
  "servers": [{ "url": "https://mcp.commerceforagents.com", "description": "Production" }],
  "paths": {
    "/mcp": {
      "post": {
        "operationId": "mcp",
        "summary": "MCP JSON-RPC endpoint (Streamable HTTP)",
        "description": "Send one JSON-RPC 2.0 request per call: initialize, tools/list, tools/call. The server is stateless; no session is required and no authentication is used.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/JsonRpcRequest" },
              "examples": {
                "listTools": { "value": { "jsonrpc": "2.0", "id": 1, "method": "tools/list", "params": {} } },
                "compare": { "value": { "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "compare-tariffs", "arguments": { "energyType": "electricity", "postalCode": "10115", "annualConsumptionKwh": 2500 } } } }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response, as JSON or as a server-sent event stream depending on the Accept header.",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/JsonRpcResponse" } },
              "text/event-stream": { "schema": { "type": "string" } }
            }
          },
          "400": { "description": "Malformed JSON-RPC request." }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "JsonRpcRequest": {
        "type": "object",
        "required": ["jsonrpc", "method"],
        "properties": {
          "jsonrpc": { "type": "string", "const": "2.0" },
          "id": { "oneOf": [{ "type": "string" }, { "type": "integer" }] },
          "method": { "type": "string", "enum": ["initialize", "notifications/initialized", "tools/list", "tools/call", "ping"] },
          "params": { "type": "object", "additionalProperties": true }
        }
      },
      "JsonRpcResponse": {
        "type": "object",
        "required": ["jsonrpc"],
        "properties": {
          "jsonrpc": { "type": "string", "const": "2.0" },
          "id": { "oneOf": [{ "type": "string" }, { "type": "integer" }, { "type": "null" }] },
          "result": { "type": "object", "additionalProperties": true },
          "error": { "type": "object", "properties": { "code": { "type": "integer" }, "message": { "type": "string" } } }
        }
      }
    }
  },
  "x-mcp": {
    "transport": "streamable-http",
    "authentication": "none",
    "tools": ["compare-tariffs", "tariff-details", "book-contract", "compare-broadband", "compare-mobile-plans"],
    "serverCard": "https://commerceforagents.com/.well-known/mcp/server-card.json"
  }
}
