{
  "openapi": "3.0.3",
  "info": {
    "title": "MovingCostLab Agent API",
    "version": "1.0.0",
    "description": "Read-only public lookup over MovingCostLab published articles. No accounts, no bookings, no payments, no write operations. Prices and facts come from the cited article pages, with each article's own Updated date."
  },
  "servers": [
    {
      "url": "https://movingcostlab.com"
    }
  ],
  "paths": {
    "/api/agent": {
      "get": {
        "summary": "Service index",
        "operationId": "agentIndex",
        "responses": {
          "200": {
            "description": "Service index with endpoints",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/search": {
      "get": {
        "summary": "Search published pages",
        "operationId": "searchPages",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Search words, e.g. PODS cheaper U-Haul"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10,
              "default": 5
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching pages, possibly empty",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Missing q",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/articles": {
      "get": {
        "summary": "List published pages in the search index",
        "operationId": "listArticles",
        "responses": {
          "200": {
            "description": "Page list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/article": {
      "get": {
        "summary": "Read one published page",
        "operationId": "getArticle",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Page slug, e.g. pods-vs-uhaul"
          },
          {
            "name": "url",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Full page URL on movingcostlab.com"
          }
        ],
        "responses": {
          "200": {
            "description": "Page title, description and extracted text",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "No such page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "summary": "MCP Streamable HTTP endpoint (JSON-RPC)",
        "operationId": "mcp",
        "description": "Implements initialize, tools/list and tools/call for search_moving_cost_pages and get_moving_cost_page. See /.well-known/mcp/server-card.json.",
        "responses": {
          "200": {
            "description": "JSON-RPC response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  }
}
