{
  "openapi": "3.1.0",
  "info": {
    "title": "PaisaLocal",
    "version": "0.1.0",
    "description": "Prices outdoor kitchens, concrete and stone walls in Dallas-Fort Worth and books site visits. Each operation is one tool of PaisaLocal's MCP server, called as a JSON-RPC 2.0 tools/call POST to https://api.paisalocal.com/api/mcp (MCP Streamable HTTP, stateless, JSON responses, no sign-in). The #fragment in each path only keeps the operations apart and is never sent. One tool call per request. The same actions are also a REST API under https://api.paisalocal.com/api/v1 (JSON in and out, no sign-in, Dallas-Fort Worth only): errors are { error, code, message }, every reply carries the API-Version header. Rate limit: 20 requests per 5 minutes per caller across the estimate, contractors, site visit and search endpoints. Every reply carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (seconds until the window resets); a 429 carries Retry-After. Sandbox: send X-Sandbox: true to test; nothing is saved, booked or sent. The API is versioned under /api/v1. Breaking changes ship under a new version. The previous version keeps working for at least 90 days after the new one is announced, and during that window replies carry Deprecation and Sunset headers and /developers lists the date.",
    "contact": {
      "name": "PaisaLocal",
      "url": "https://www.paisalocal.com"
    }
  },
  "externalDocs": {
    "description": "Connect PaisaLocal to an AI assistant",
    "url": "https://www.paisalocal.com/connector"
  },
  "servers": [
    {
      "url": "https://api.paisalocal.com"
    },
    {
      "url": "https://www.paisalocal.com"
    }
  ],
  "tags": [
    {
      "name": "MCP tools",
      "description": "The tools listed by tools/list at https://api.paisalocal.com/api/mcp"
    },
    {
      "name": "REST API",
      "description": "The public REST API under https://api.paisalocal.com/api/v1",
      "externalDocs": {
        "url": "https://www.paisalocal.com/developers"
      }
    }
  ],
  "paths": {
    "/api/mcp#find_contractor": {
      "servers": [
        {
          "url": "https://api.paisalocal.com"
        }
      ],
      "post": {
        "operationId": "find_contractor",
        "summary": "Find a contractor",
        "description": "Check whether PaisaLocal builds this type of outdoor project at this ZIP code or city (Dallas-Fort Worth only). project_type: retaining-wall, outdoor-kitchen, concrete (patio/driveway), curb-stone (edging) or french-drain.",
        "tags": [
          "MCP tools"
        ],
        "x-mcp-tool": "find_contractor",
        "x-mcp-annotations": {
          "title": "Find a contractor",
          "readOnlyHint": true,
          "destructiveHint": false,
          "idempotentHint": true,
          "openWorldHint": false
        },
        "requestBody": {
          "required": true,
          "description": "A JSON-RPC 2.0 tools/call request for find_contractor. The fragment in the path is not sent: post it to https://api.paisalocal.com/api/mcp.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jsonrpc",
                  "id",
                  "method",
                  "params"
                ],
                "properties": {
                  "jsonrpc": {
                    "const": "2.0"
                  },
                  "id": {
                    "type": [
                      "string",
                      "integer"
                    ],
                    "description": "Any request id; the reply carries it back"
                  },
                  "method": {
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "required": [
                      "name",
                      "arguments"
                    ],
                    "properties": {
                      "name": {
                        "const": "find_contractor"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "zip": {
                            "description": "5-digit US ZIP code of the job (send zip or city; the ZIP wins if both)",
                            "type": "string",
                            "maxLength": 10
                          },
                          "city": {
                            "description": "Dallas-Fort Worth city of the job, e.g. Grapevine (send zip or city)",
                            "type": "string",
                            "maxLength": 60
                          },
                          "project_type": {
                            "type": "string",
                            "maxLength": 40,
                            "description": "retaining-wall | outdoor-kitchen | concrete | curb-stone | french-drain"
                          }
                        },
                        "required": [
                          "project_type"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response. result.structuredContent is the tool result as JSON and result.content carries it as text. result.isError is true when the arguments were refused (the message says which one).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonRpcResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/JsonRpcError"
          },
          "406": {
            "$ref": "#/components/responses/JsonRpcError"
          },
          "413": {
            "$ref": "#/components/responses/JsonRpcError"
          },
          "429": {
            "$ref": "#/components/responses/JsonRpcError"
          }
        }
      }
    },
    "/api/mcp#get_estimate": {
      "servers": [
        {
          "url": "https://api.paisalocal.com"
        }
      ],
      "post": {
        "operationId": "get_estimate",
        "summary": "Get a price",
        "description": "Price an outdoor job in Dallas-Fort Worth, line by line, from PaisaLocal's own price list. Needs only the size and a zip or city: concrete length_ft and width_ft, a wall length_ft and height_ft, a kitchen length_ft. Stone, layout, appliances, countertop and finish are optional; what is left out is priced with our pick and listed in assumptions, with options to change it. Returns the installed price and an estimate_id. request_site_visit takes that id to book the visit that confirms the price.",
        "tags": [
          "MCP tools"
        ],
        "x-mcp-tool": "get_estimate",
        "x-mcp-annotations": {
          "title": "Get a price",
          "readOnlyHint": false,
          "destructiveHint": false,
          "idempotentHint": false,
          "openWorldHint": false
        },
        "requestBody": {
          "required": true,
          "description": "A JSON-RPC 2.0 tools/call request for get_estimate. The fragment in the path is not sent: post it to https://api.paisalocal.com/api/mcp.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jsonrpc",
                  "id",
                  "method",
                  "params"
                ],
                "properties": {
                  "jsonrpc": {
                    "const": "2.0"
                  },
                  "id": {
                    "type": [
                      "string",
                      "integer"
                    ],
                    "description": "Any request id; the reply carries it back"
                  },
                  "method": {
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "required": [
                      "name",
                      "arguments"
                    ],
                    "properties": {
                      "name": {
                        "const": "get_estimate"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "zip": {
                            "description": "5-digit US ZIP code of the job (send zip or city; the ZIP wins if both)",
                            "type": "string",
                            "maxLength": 10
                          },
                          "city": {
                            "description": "Dallas-Fort Worth city of the job, e.g. Grapevine (send zip or city)",
                            "type": "string",
                            "maxLength": 60
                          },
                          "project_type": {
                            "type": "string",
                            "maxLength": 40,
                            "description": "concrete | retaining-wall | outdoor-kitchen (curb-stone, french-drain: priced on paisalocal.com)"
                          },
                          "length_ft": {
                            "type": "number",
                            "description": "Length in feet (outdoor kitchen: total counter run in linear feet)"
                          },
                          "width_ft": {
                            "description": "Concrete only: width in feet",
                            "type": "number"
                          },
                          "height_ft": {
                            "description": "Retaining wall only: height in feet",
                            "type": "number"
                          },
                          "finish": {
                            "description": "Concrete only, optional: broom, salt, exposed or stamped (left out: broom, our pick)",
                            "type": "string",
                            "enum": [
                              "broom",
                              "salt",
                              "exposed",
                              "stamped"
                            ]
                          },
                          "use": {
                            "description": "Concrete only: patio (default), driveway, sidewalk, walkway, slab, hot_tub (pad), trailer (RV/boat) or heavy (equipment)",
                            "type": "string",
                            "enum": [
                              "patio",
                              "driveway",
                              "sidewalk",
                              "walkway",
                              "slab",
                              "hot_tub",
                              "trailer",
                              "heavy"
                            ]
                          },
                          "stone": {
                            "description": "Retaining wall or outdoor kitchen, optional: natural stone name (left out: our pick)",
                            "type": "string",
                            "maxLength": 80
                          },
                          "layout": {
                            "description": "Outdoor kitchen only, optional: straight, L or U (left out: straight, our pick)",
                            "type": "string",
                            "enum": [
                              "straight",
                              "L",
                              "U"
                            ]
                          },
                          "appliances": {
                            "description": "Outdoor kitchen only, optional: compact_chef, entertainer, pitmaster or structure_only (no appliances); must fit the run; left out: our pick",
                            "type": "string",
                            "enum": [
                              "compact_chef",
                              "entertainer",
                              "pitmaster",
                              "structure_only"
                            ]
                          },
                          "countertop": {
                            "description": "Outdoor kitchen only, optional: countertop slab name (left out: our pick)",
                            "type": "string",
                            "maxLength": 80
                          },
                          "mortar_color": {
                            "description": "Retaining wall or outdoor kitchen, optional: mortar color, Light Buff, Dark Buff, Dark Red, Gray, White, Charcoal (left out: Gray, our pick)",
                            "type": "string",
                            "enum": [
                              "Light Buff",
                              "Dark Buff",
                              "Dark Red",
                              "Gray",
                              "White",
                              "Charcoal"
                            ]
                          }
                        },
                        "required": [
                          "project_type",
                          "length_ft"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response. result.structuredContent is the tool result as JSON and result.content carries it as text. result.isError is true when the arguments were refused (the message says which one).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonRpcResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/JsonRpcError"
          },
          "406": {
            "$ref": "#/components/responses/JsonRpcError"
          },
          "413": {
            "$ref": "#/components/responses/JsonRpcError"
          },
          "429": {
            "$ref": "#/components/responses/JsonRpcError"
          }
        }
      }
    },
    "/api/mcp#request_site_visit": {
      "servers": [
        {
          "url": "https://api.paisalocal.com"
        }
      ],
      "post": {
        "operationId": "request_site_visit",
        "summary": "Book a site visit",
        "description": "Book PaisaLocal's site visit for an estimate from get_estimate. Call it first with estimate_id alone to get the open times, then again with one slot_date from that list plus the homeowner's name and email. Phone and the job's street address are optional; without an address PaisaLocal emails the homeowner for it. Only offered times can be booked. No deposit is taken. Returns the installed price and an estimate_id. request_site_visit takes that id to book the visit that confirms the price.",
        "tags": [
          "MCP tools"
        ],
        "x-mcp-tool": "request_site_visit",
        "x-mcp-annotations": {
          "title": "Book a site visit",
          "readOnlyHint": false,
          "destructiveHint": false,
          "idempotentHint": false,
          "openWorldHint": true
        },
        "requestBody": {
          "required": true,
          "description": "A JSON-RPC 2.0 tools/call request for request_site_visit. The fragment in the path is not sent: post it to https://api.paisalocal.com/api/mcp.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jsonrpc",
                  "id",
                  "method",
                  "params"
                ],
                "properties": {
                  "jsonrpc": {
                    "const": "2.0"
                  },
                  "id": {
                    "type": [
                      "string",
                      "integer"
                    ],
                    "description": "Any request id; the reply carries it back"
                  },
                  "method": {
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "required": [
                      "name",
                      "arguments"
                    ],
                    "properties": {
                      "name": {
                        "const": "request_site_visit"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "estimate_id": {
                            "type": "string",
                            "maxLength": 80,
                            "description": "estimate_id returned by get_estimate"
                          },
                          "slot_date": {
                            "description": "One slot_date exactly as returned by a previous request_site_visit call",
                            "type": "string",
                            "maxLength": 40
                          },
                          "name": {
                            "description": "Homeowner name (needed to book)",
                            "type": "string",
                            "maxLength": 120
                          },
                          "email": {
                            "description": "Homeowner email (needed to book)",
                            "type": "string",
                            "maxLength": 254
                          },
                          "phone": {
                            "description": "Homeowner phone (optional)",
                            "type": "string",
                            "maxLength": 40
                          },
                          "address": {
                            "description": "Street address of the job with the house number (optional; PaisaLocal asks by email if left out)",
                            "type": "string",
                            "maxLength": 200
                          }
                        },
                        "required": [
                          "estimate_id"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response. result.structuredContent is the tool result as JSON and result.content carries it as text. result.isError is true when the arguments were refused (the message says which one).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonRpcResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/JsonRpcError"
          },
          "406": {
            "$ref": "#/components/responses/JsonRpcError"
          },
          "413": {
            "$ref": "#/components/responses/JsonRpcError"
          },
          "429": {
            "$ref": "#/components/responses/JsonRpcError"
          }
        }
      }
    },
    "/api/mcp#search_site": {
      "servers": [
        {
          "url": "https://api.paisalocal.com"
        }
      ],
      "post": {
        "operationId": "search_site",
        "summary": "Search the site",
        "description": "Search paisalocal.com's public pages (Dallas-Fort Worth city cost pages, stone pages, guides, blog posts, developer docs) and return the best matches, each with title, url, description, city, project_type and dateModified. q is the search words. project_type (concrete, retaining-wall, outdoor-kitchen, curb-stone, french-drain) and city (a Dallas-Fort Worth city name) narrow the results. Send q, a filter, or both. Paginated with limit and offset. Read only.",
        "tags": [
          "MCP tools"
        ],
        "x-mcp-tool": "search_site",
        "x-mcp-annotations": {
          "title": "Search the site",
          "readOnlyHint": true,
          "destructiveHint": false,
          "idempotentHint": true,
          "openWorldHint": false
        },
        "requestBody": {
          "required": true,
          "description": "A JSON-RPC 2.0 tools/call request for search_site. The fragment in the path is not sent: post it to https://api.paisalocal.com/api/mcp.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jsonrpc",
                  "id",
                  "method",
                  "params"
                ],
                "properties": {
                  "jsonrpc": {
                    "const": "2.0"
                  },
                  "id": {
                    "type": [
                      "string",
                      "integer"
                    ],
                    "description": "Any request id; the reply carries it back"
                  },
                  "method": {
                    "const": "tools/call"
                  },
                  "params": {
                    "type": "object",
                    "required": [
                      "name",
                      "arguments"
                    ],
                    "properties": {
                      "name": {
                        "const": "search_site"
                      },
                      "arguments": {
                        "type": "object",
                        "properties": {
                          "q": {
                            "description": "Search words, e.g. retaining wall keller",
                            "type": "string",
                            "maxLength": 200
                          },
                          "project_type": {
                            "description": "Only pages about this project: concrete, retaining-wall, outdoor-kitchen, curb-stone or french-drain",
                            "type": "string",
                            "enum": [
                              "concrete",
                              "retaining-wall",
                              "outdoor-kitchen",
                              "curb-stone",
                              "french-drain"
                            ]
                          },
                          "city": {
                            "description": "Only pages for this Dallas-Fort Worth city, e.g. Keller (any case)",
                            "type": "string",
                            "maxLength": 60
                          },
                          "limit": {
                            "default": 10,
                            "description": "Page size, 1 to 50 (default 10)",
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 50
                          },
                          "offset": {
                            "default": 0,
                            "description": "How many matches to skip (default 0); send the reply's nextOffset to get the next page",
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 10000
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response. result.structuredContent is the tool result as JSON and result.content carries it as text. result.isError is true when the arguments were refused (the message says which one).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonRpcResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/JsonRpcError"
          },
          "406": {
            "$ref": "#/components/responses/JsonRpcError"
          },
          "413": {
            "$ref": "#/components/responses/JsonRpcError"
          },
          "429": {
            "$ref": "#/components/responses/JsonRpcError"
          }
        }
      }
    },
    "/api/v1/estimate": {
      "post": {
        "operationId": "createEstimate",
        "summary": "Get a price",
        "description": "PaisaLocal's installed price for a job in Dallas-Fort Worth, line by line, from its own price list (the same quote paisalocal.com gives). Needs only the size and a zip or city (the ZIP wins if both): concrete length_ft and width_ft, a retaining wall length_ft and height_ft, an outdoor kitchen length_ft (counter run, 8 to 24). Stone, layout, appliances, countertop and finish are optional: what is left out is priced with our pick, listed in assumptions (basis \"our pick\"), with options (photo URLs for stones, slabs and finishes) to change it in one more call. Refused only for a missing size, a missing location or a location outside Dallas-Fort Worth. Saves the estimate; estimateId books the site visit. Returns the installed price and an estimate_id. request_site_visit takes that id to book the visit that confirms the price. Rate limit: 20 requests per 5 minutes per caller across the estimate, contractors, site visit and search endpoints. Every reply carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (seconds until the window resets); a 429 carries Retry-After.",
        "tags": [
          "REST API"
        ],
        "parameters": [
          {
            "name": "X-Sandbox",
            "in": "header",
            "required": false,
            "description": "Send true to test: the call runs and answers as usual, but nothing is saved, booked or sent. The reply carries X-Sandbox: true and sandbox: true; a site visit answers probe_ok with booked false. Sandbox calls still count against the rate limit.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "example": "true"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "city": {
                    "description": "Dallas-Fort Worth city of the job, e.g. Grapevine (send zip or city)",
                    "type": "string",
                    "maxLength": 60
                  },
                  "length_ft": {
                    "type": "number",
                    "description": "Length in feet (outdoor kitchen: total counter run in linear feet)"
                  },
                  "width_ft": {
                    "description": "Concrete only: width in feet",
                    "type": "number"
                  },
                  "height_ft": {
                    "description": "Retaining wall only: height in feet",
                    "type": "number"
                  },
                  "finish": {
                    "description": "Concrete only, optional: broom, salt, exposed or stamped (left out: broom, our pick)",
                    "type": "string",
                    "enum": [
                      "broom",
                      "salt",
                      "exposed",
                      "stamped"
                    ]
                  },
                  "use": {
                    "description": "Concrete only: patio (default), driveway, sidewalk, walkway, slab, hot_tub (pad), trailer (RV/boat) or heavy (equipment)",
                    "type": "string",
                    "enum": [
                      "patio",
                      "driveway",
                      "sidewalk",
                      "walkway",
                      "slab",
                      "hot_tub",
                      "trailer",
                      "heavy"
                    ]
                  },
                  "stone": {
                    "description": "Retaining wall or outdoor kitchen, optional: natural stone name (left out: our pick)",
                    "type": "string",
                    "maxLength": 80
                  },
                  "layout": {
                    "description": "Outdoor kitchen only, optional: straight, L or U (left out: straight, our pick)",
                    "type": "string",
                    "enum": [
                      "straight",
                      "L",
                      "U"
                    ]
                  },
                  "appliances": {
                    "description": "Outdoor kitchen only, optional: compact_chef, entertainer, pitmaster or structure_only (no appliances); must fit the run; left out: our pick",
                    "type": "string",
                    "enum": [
                      "compact_chef",
                      "entertainer",
                      "pitmaster",
                      "structure_only"
                    ]
                  },
                  "countertop": {
                    "description": "Outdoor kitchen only, optional: countertop slab name (left out: our pick)",
                    "type": "string",
                    "maxLength": 80
                  },
                  "mortar_color": {
                    "description": "Retaining wall or outdoor kitchen, optional: mortar color, Light Buff, Dark Buff, Dark Red, Gray, White, Charcoal (left out: Gray, our pick)",
                    "type": "string",
                    "enum": [
                      "Light Buff",
                      "Dark Buff",
                      "Dark Red",
                      "Gray",
                      "White",
                      "Charcoal"
                    ]
                  },
                  "zip": {
                    "description": "5-digit US ZIP code of the job (send zip or city; the ZIP wins if both)",
                    "type": "string",
                    "maxLength": 10
                  },
                  "project_type": {
                    "type": "string",
                    "enum": [
                      "concrete",
                      "retaining-wall",
                      "outdoor-kitchen"
                    ],
                    "description": "concrete (patio, driveway, sidewalk, slab: set use), retaining-wall or outdoor-kitchen"
                  }
                },
                "required": [
                  "length_ft",
                  "project_type"
                ]
              },
              "example": {
                "city": "Grapevine",
                "project_type": "outdoor-kitchen",
                "length_ft": 12
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Priced. totalCost is the sum of lines (USD). estimateId books the site visit; location says which ZIP was priced.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Estimate"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/RestError"
          },
          "413": {
            "$ref": "#/components/responses/RestError"
          },
          "422": {
            "$ref": "#/components/responses/RestError"
          },
          "429": {
            "$ref": "#/components/responses/RestError"
          },
          "503": {
            "$ref": "#/components/responses/RestError"
          }
        }
      }
    },
    "/api/v1/contractors": {
      "get": {
        "operationId": "findContractors",
        "summary": "Find a contractor",
        "description": "Whether PaisaLocal builds this type of project at this location (Dallas-Fort Worth only). Read only. Paginated with limit and offset: the reply carries total, limit, offset and nextOffset (null on the last page). Rate limit: 20 requests per 5 minutes per caller across the estimate, contractors, site visit and search endpoints. Every reply carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (seconds until the window resets); a 429 carries Retry-After.",
        "tags": [
          "REST API"
        ],
        "parameters": [
          {
            "name": "zip",
            "in": "query",
            "required": false,
            "description": "5-digit US ZIP code of the job (send zip or city; the ZIP wins if both)",
            "schema": {
              "description": "5-digit US ZIP code of the job (send zip or city; the ZIP wins if both)",
              "type": "string",
              "maxLength": 10
            }
          },
          {
            "name": "city",
            "in": "query",
            "required": false,
            "description": "Dallas-Fort Worth city of the job, e.g. Grapevine (send zip or city)",
            "schema": {
              "description": "Dallas-Fort Worth city of the job, e.g. Grapevine (send zip or city)",
              "type": "string",
              "maxLength": 60
            },
            "example": "Grapevine"
          },
          {
            "name": "project_type",
            "in": "query",
            "required": true,
            "description": "concrete, retaining-wall, outdoor-kitchen, curb-stone (edging) or french-drain",
            "schema": {
              "type": "string",
              "enum": [
                "retaining-wall",
                "outdoor-kitchen",
                "concrete",
                "curb-stone",
                "french-drain"
              ],
              "description": "concrete, retaining-wall, outdoor-kitchen, curb-stone (edging) or french-drain"
            },
            "example": "concrete"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1 to 50 (default 10)",
            "schema": {
              "default": 10,
              "description": "Page size, 1 to 50 (default 10)",
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "How many contractors to skip (default 0); send the reply's nextOffset to get the next page",
            "schema": {
              "default": 0,
              "description": "How many contractors to skip (default 0); send the reply's nextOffset to get the next page",
              "type": "integer",
              "minimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "X-Sandbox",
            "in": "header",
            "required": false,
            "description": "Send true to test: the call runs and answers as usual, but nothing is saved, booked or sent. The reply carries X-Sandbox: true and sandbox: true; a site visit answers probe_ok with booked false. Sandbox calls still count against the rate limit.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "example": "true"
          }
        ],
        "responses": {
          "200": {
            "description": "Who builds this project at this location. PaisaLocal is listed first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contractors"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/RestError"
          },
          "422": {
            "$ref": "#/components/responses/RestError"
          },
          "429": {
            "$ref": "#/components/responses/RestError"
          }
        }
      }
    },
    "/api/v1/site-visit": {
      "post": {
        "operationId": "requestSiteVisit",
        "summary": "Book a site visit",
        "description": "Book PaisaLocal's site visit for an estimate. Send estimate_id alone to get the open times (reason pick_slot, slots), then again with one slot_date from that list plus the homeowner's name and email. Phone and street address are optional. Only offered times can be booked. No deposit is taken. Send an Idempotency-Key header (any unique string, up to 255 characters, e.g. a UUID) to retry safely: for 24 hours the same key with the same body returns the first answer again (Idempotent-Replayed: true) and books nothing twice; the same key with a different body is a 422 (idempotency_key_reused), and a retry while the first call is still running is a 409. Returns the installed price and an estimate_id. request_site_visit takes that id to book the visit that confirms the price. Rate limit: 20 requests per 5 minutes per caller across the estimate, contractors, site visit and search endpoints. Every reply carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (seconds until the window resets); a 429 carries Retry-After.",
        "tags": [
          "REST API"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Any unique string (a UUID works), 1 to 255 visible ASCII characters. For 24 hours, the same key with the same body returns the first answer again (Idempotent-Replayed: true) and nothing runs twice; the same key with a different body is a 422 idempotency_key_reused; a retry while the first call still runs is a 409 idempotency_in_progress. Only successful answers are kept: after a refusal, the same key runs again.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            },
            "example": "5f0c6c1e-8a4b-4c55-9d1a-2b7e0f3a9c41"
          },
          {
            "name": "X-Sandbox",
            "in": "header",
            "required": false,
            "description": "Send true to test: the call runs and answers as usual, but nothing is saved, booked or sent. The reply carries X-Sandbox: true and sandbox: true; a site visit answers probe_ok with booked false. Sandbox calls still count against the rate limit.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "example": "true"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "estimate_id": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "estimate_id returned by get_estimate"
                  },
                  "slot_date": {
                    "description": "One slot_date exactly as returned by a previous request_site_visit call",
                    "type": "string",
                    "maxLength": 40
                  },
                  "name": {
                    "description": "Homeowner name (needed to book)",
                    "type": "string",
                    "maxLength": 120
                  },
                  "email": {
                    "description": "Homeowner email (needed to book)",
                    "type": "string",
                    "maxLength": 254
                  },
                  "phone": {
                    "description": "Homeowner phone (optional)",
                    "type": "string",
                    "maxLength": 40
                  },
                  "address": {
                    "description": "Street address of the job with the house number (optional; PaisaLocal asks by email if left out)",
                    "type": "string",
                    "maxLength": 200
                  }
                },
                "required": [
                  "estimate_id"
                ]
              },
              "example": {
                "estimate_id": "mcp_00000000-0000-4000-8000-000000000000"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "reason pick_slot (with slots to choose from), booked, or probe_ok for a marked test request (booked false).",
            "headers": {
              "Idempotent-Replayed": {
                "description": "true when this answer is the stored answer to an earlier request with the same Idempotency-Key and body (nothing ran again). Absent otherwise.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteVisit"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/RestError"
          },
          "404": {
            "$ref": "#/components/responses/RestError"
          },
          "409": {
            "$ref": "#/components/responses/RestError"
          },
          "413": {
            "$ref": "#/components/responses/RestError"
          },
          "422": {
            "$ref": "#/components/responses/RestError"
          },
          "429": {
            "$ref": "#/components/responses/RestError"
          },
          "503": {
            "$ref": "#/components/responses/RestError"
          }
        }
      }
    },
    "/api/v1/search": {
      "get": {
        "operationId": "searchSite",
        "summary": "Search the site",
        "description": "Search paisalocal.com's public pages (Dallas-Fort Worth city cost pages, stone pages, guides, blog posts, developer docs) and get ranked matches, best first, each with title, url, description, city, project_type and dateModified. Send q, or filter with project_type and city (case-insensitive), or both; neither is a 400 (needs_query). Read only; the same function answers the MCP tool search_site. Paginated with limit and offset: the reply carries total, limit, offset and nextOffset (null on the last page). Rate limit: 20 requests per 5 minutes per caller across the estimate, contractors, site visit and search endpoints. Every reply carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (seconds until the window resets); a 429 carries Retry-After.",
        "tags": [
          "REST API"
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Search words, e.g. retaining wall keller",
            "schema": {
              "description": "Search words, e.g. retaining wall keller",
              "type": "string",
              "maxLength": 200
            },
            "example": "retaining wall keller"
          },
          {
            "name": "project_type",
            "in": "query",
            "required": false,
            "description": "Only pages about this project: concrete, retaining-wall, outdoor-kitchen, curb-stone or french-drain",
            "schema": {
              "description": "Only pages about this project: concrete, retaining-wall, outdoor-kitchen, curb-stone or french-drain",
              "type": "string",
              "enum": [
                "concrete",
                "retaining-wall",
                "outdoor-kitchen",
                "curb-stone",
                "french-drain"
              ]
            }
          },
          {
            "name": "city",
            "in": "query",
            "required": false,
            "description": "Only pages for this Dallas-Fort Worth city, e.g. Keller (any case)",
            "schema": {
              "description": "Only pages for this Dallas-Fort Worth city, e.g. Keller (any case)",
              "type": "string",
              "maxLength": 60
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1 to 50 (default 10)",
            "schema": {
              "default": 10,
              "description": "Page size, 1 to 50 (default 10)",
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "How many matches to skip (default 0); send the reply's nextOffset to get the next page",
            "schema": {
              "default": 0,
              "description": "How many matches to skip (default 0); send the reply's nextOffset to get the next page",
              "type": "integer",
              "minimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "X-Sandbox",
            "in": "header",
            "required": false,
            "description": "Send true to test: the call runs and answers as usual, but nothing is saved, booked or sent. The reply carries X-Sandbox: true and sandbox: true; a site visit answers probe_ok with booked false. Sandbox calls still count against the rate limit.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "example": "true"
          }
        ],
        "responses": {
          "200": {
            "description": "Ranked matches from the paisalocal.com search index (best first), one page of them; total counts every match.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Search"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/RestError"
          },
          "429": {
            "$ref": "#/components/responses/RestError"
          },
          "503": {
            "$ref": "#/components/responses/RestError"
          }
        }
      }
    },
    "/api/v1/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "API health",
        "description": "Liveness of the API: top-level version (the API version, also sent as the API-Version header) and status.",
        "tags": [
          "REST API"
        ],
        "responses": {
          "200": {
            "description": "The API is up.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "version",
                    "status"
                  ],
                  "properties": {
                    "version": {
                      "type": "string",
                      "example": "v1"
                    },
                    "status": {
                      "type": "string",
                      "example": "healthy"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "JsonRpcResponse": {
        "type": "object",
        "required": [
          "jsonrpc",
          "id"
        ],
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": [
              "string",
              "integer",
              "null"
            ]
          },
          "result": {
            "type": "object",
            "properties": {
              "content": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "structuredContent": {
                "type": "object"
              },
              "isError": {
                "type": "boolean"
              }
            }
          },
          "error": {
            "$ref": "#/components/schemas/JsonRpcErrorObject"
          }
        }
      },
      "JsonRpcErrorObject": {
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "integer"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "RestError": {
        "type": "object",
        "required": [
          "error",
          "code",
          "message"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "The HTTP status text",
            "example": "Unprocessable Entity"
          },
          "code": {
            "type": "string",
            "description": "Machine-readable reason, e.g. out_of_area, not_offered, invalid_zip, needs_location, needs_query, search_unavailable, rate_limited, not_found, idempotency_key_reused, idempotency_in_progress",
            "example": "out_of_area"
          },
          "message": {
            "type": "string",
            "description": "What to do next, in plain words",
            "example": "Ask the homeowner which finish: broom, salt, exposed aggregate or stamped."
          }
        },
        "additionalProperties": true,
        "description": "A refusal may carry the choices to ask about (finishChoices, layoutChoices, suggestedStones, stoneOptions, applianceChoices, countertopChoices) and continueUrl."
      },
      "Estimate": {
        "type": "object",
        "required": [
          "totalCost",
          "currency",
          "lines",
          "estimateId",
          "job",
          "location"
        ],
        "properties": {
          "totalCost": {
            "type": "integer",
            "example": 3240
          },
          "currency": {
            "const": "USD"
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "label",
                "amount"
              ],
              "properties": {
                "label": {
                  "type": "string"
                },
                "amount": {
                  "type": "integer"
                }
              }
            }
          },
          "estimateId": {
            "type": "string",
            "example": "mcp_00000000-0000-4000-8000-000000000000"
          },
          "job": {
            "type": "object"
          },
          "location": {
            "type": "object",
            "properties": {
              "city": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "zip": {
                "type": "string"
              },
              "from": {
                "enum": [
                  "zip",
                  "city"
                ]
              }
            }
          },
          "contractor": {
            "type": "object"
          },
          "continueUrl": {
            "type": "string"
          },
          "seeItInYourYardUrl": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "Contractors": {
        "type": "object",
        "required": [
          "contractors",
          "total",
          "limit",
          "offset",
          "nextOffset",
          "location"
        ],
        "properties": {
          "contractors": {
            "type": "array",
            "description": "This page of contractors (limit at most, from offset)",
            "items": {
              "type": "object",
              "properties": {
                "slug": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "serviceArea": {
                  "type": "string"
                },
                "projectType": {
                  "type": "string"
                },
                "estimateUrl": {
                  "type": "string"
                }
              }
            }
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "description": "How many contractors match, across all pages",
            "example": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "description": "The page size used",
            "example": 10
          },
          "offset": {
            "type": "integer",
            "minimum": 0,
            "description": "How many were skipped before this page",
            "example": 0
          },
          "nextOffset": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The offset of the next page; null on the last page",
            "example": null
          },
          "location": {
            "type": "object"
          }
        }
      },
      "Search": {
        "type": "object",
        "required": [
          "results",
          "total",
          "limit",
          "offset",
          "nextOffset"
        ],
        "properties": {
          "results": {
            "type": "array",
            "description": "This page of matching paisalocal.com pages, best match first",
            "items": {
              "type": "object",
              "required": [
                "title",
                "url",
                "description",
                "city",
                "project_type",
                "dateModified"
              ],
              "properties": {
                "title": {
                  "type": "string",
                  "description": "The page title"
                },
                "url": {
                  "type": "string",
                  "description": "The page URL on www.paisalocal.com"
                },
                "description": {
                  "type": "string",
                  "description": "The page description"
                },
                "city": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The Dallas-Fort Worth city of a per-city page, else null"
                },
                "project_type": {
                  "enum": [
                    "concrete",
                    "retaining-wall",
                    "outdoor-kitchen",
                    "curb-stone",
                    "french-drain",
                    null
                  ],
                  "description": "The project the page is about, else null"
                },
                "dateModified": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "When the page last changed (YYYY-MM-DD), null when it publishes no date"
                }
              }
            }
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "description": "How many pages match, across all pages of results",
            "example": 3
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "description": "The page size used",
            "example": 10
          },
          "offset": {
            "type": "integer",
            "minimum": 0,
            "description": "How many matches were skipped before this page",
            "example": 0
          },
          "nextOffset": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The offset of the next page; null on the last page",
            "example": null
          }
        }
      },
      "SiteVisit": {
        "type": "object",
        "required": [
          "reason"
        ],
        "properties": {
          "reason": {
            "type": "string"
          },
          "booked": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "slots": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      }
    },
    "responses": {
      "RestError": {
        "description": "A refused REST request: { error, code, message }, plus the choices to ask about when the code is a needs_* question.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/RestError"
            }
          }
        }
      },
      "JsonRpcError": {
        "description": "Refused before any tool ran: a malformed or oversize body (400/413), an Accept header that rules out application/json (406), or the per-caller rate limit (429).",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "jsonrpc",
                "error"
              ],
              "properties": {
                "jsonrpc": {
                  "const": "2.0"
                },
                "id": {
                  "type": [
                    "string",
                    "integer",
                    "null"
                  ]
                },
                "error": {
                  "$ref": "#/components/schemas/JsonRpcErrorObject"
                }
              }
            }
          }
        }
      }
    }
  }
}
