[
  {
    "name": "search_businesses",
    "description": "Search for local businesses and restaurants on Yelp by term and location. Returns matching businesses with star ratings, review counts, price, categories, address, and phone. Example: search_businesses({ term: \"pizza\", location: \"San Francisco, CA\" }).",
    "inputSchema": {
      "type": "object",
      "properties": {
        "term": {
          "type": "string",
          "description": "Search term, e.g. \"coffee\", \"pizza\", \"plumber\". Optional."
        },
        "location": {
          "type": "string",
          "description": "Location to search, e.g. \"San Francisco, CA\" or \"New York\". Provide this OR latitude+longitude."
        },
        "latitude": {
          "type": "number",
          "description": "Latitude of the search center. Use with longitude instead of location."
        },
        "longitude": {
          "type": "number",
          "description": "Longitude of the search center. Use with latitude instead of location."
        },
        "limit": {
          "type": "number",
          "description": "Number of results to return (default 20, max 50)."
        },
        "sort_by": {
          "type": "string",
          "description": "Sort order: \"best_match\" (default), \"rating\", \"review_count\", or \"distance\".",
          "enum": [
            "best_match",
            "rating",
            "review_count",
            "distance"
          ]
        },
        "price": {
          "type": "string",
          "description": "Price filter as comma-separated levels 1-4, e.g. \"1,2,3\" for $ to $$$."
        },
        "open_now": {
          "type": "boolean",
          "description": "If true, only return businesses currently open."
        },
        "_apiKey": {
          "type": "string",
          "description": "Required — your own Yelp Fusion key. Pipeworx fronts no platform key for Yelp (Fusion plan is $229/mo, #2275 open); every call is refused with none."
        }
      }
    }
  },
  {
    "name": "get_business",
    "description": "Get full details for a single Yelp business by its id or alias. Returns rating, review count, price, categories, address, phone, hours, photos, and coordinates. Example: get_business({ id: \"garaje-san-francisco\" }).",
    "inputSchema": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Yelp business id or alias (from search_businesses results)."
        },
        "_apiKey": {
          "type": "string",
          "description": "Required — your own Yelp Fusion key. Pipeworx fronts no platform key for Yelp (Fusion plan is $229/mo, #2275 open); every call is refused with none."
        }
      },
      "required": [
        "id"
      ]
    }
  },
  {
    "name": "get_reviews",
    "description": "⚠️ UPSTREAM-UNRELIABLE — Yelp Fusion's /reviews endpoint has been 404-ing on most ids since mid-2026 even for valid businesses. PREFER `get_business` (which sometimes inlines a snippet) or `search_businesses` for review-context queries. If you must call get_reviews: pass the ENCRYPTED business id (long alphanumeric, e.g. \"WavvLdfdP6g8aZTtbBQHTw\") returned in search_businesses results — aliases / slugs (e.g. \"garaje-san-francisco\") reliably 404. Returns up to 3 review snippets per business (rating, text, author, timestamp); \"limit\" is capped by Yelp upstream regardless of what you pass.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Yelp business id or alias (from search_businesses results)."
        },
        "limit": {
          "type": "number",
          "description": "Number of reviews to return (default 3, max 50)."
        },
        "sort_by": {
          "type": "string",
          "description": "Sort order: \"yelp_sort\" (default) or \"newest\".",
          "enum": [
            "yelp_sort",
            "newest"
          ]
        },
        "_apiKey": {
          "type": "string",
          "description": "Required — your own Yelp Fusion key. Pipeworx fronts no platform key for Yelp (Fusion plan is $229/mo, #2275 open); every call is refused with none."
        }
      },
      "required": [
        "id"
      ]
    }
  }
]
