Skip to main content
Glama
miqui

yelp-mcp-sdk

by miqui

yelp-mcp-sdk

Yelp Fusion MCP server built on the official MCP Python SDK. Functionally identical to yelp-mcp-min (FastMCP), but uses the low-level Server class directly — no framework abstractions.

Prerequisites

Related MCP server: Yelp Fusion MCP Server

Installation

uv sync
cp .env.example .env
# Edit .env and set YELP_API_KEY

Running

# stdio transport (for use with Claude Desktop or an MCP client)
uv run python -m server.main

# Docker
docker build -t yelp-mcp-sdk .
docker buildx build -t yelp-mcp-sdk .
docker run --env-file .env yelp-mcp-sdk

Environment variables

Variable

Required

Default

Description

YELP_API_KEY

Yes

Yelp Fusion API bearer token

YELP_BASE_URL

No

https://api.yelp.com/v3

API base URL

HTTP_TIMEOUT

No

10.0

Request timeout in seconds

HTTP_MAX_RETRIES

No

3

Max retry attempts on 429/5xx

HTTP_RETRY_WAIT_MIN

No

1.0

Min back-off wait in seconds

HTTP_RETRY_WAIT_MAX

No

10.0

Max back-off wait in seconds

LOG_LEVEL

No

INFO

structlog level

JSON_LOGS

No

false

Emit JSON log lines

Tools

Tool

Yelp endpoint

Description

search_businesses

GET /v3/businesses/search

Full-text + geo search with pagination

find_business_by_phone

GET /v3/businesses/search/phone

Look up a business by E.164 phone number

match_business

GET /v3/businesses/matches

Match structured name+address to Yelp listing

get_business

GET /v3/businesses/{id}

Full business profile by Yelp ID or alias

get_business_reviews

GET /v3/businesses/{id}/reviews

Customer reviews with pagination

Resource

yelp://business/{id} — Full Yelp business profile as application/json. Declared via list_resource_templates; fetched via read_resource.

Project structure

yelp-mcp-sdk/
  server/
    main.py              # Server("yelp-mcp", lifespan=...) + stdio run
    core/
      config.py          # pydantic-settings
      logging.py         # structlog → stderr
      client.py          # async httpx + tenacity retry
      models.py          # Pydantic output models
    handlers/
      params.py          # Pydantic input models (also generate inputSchema)
      tools.py           # list_tools() + call_tool() dispatcher
      resources.py       # list_resource_templates() + read_resource()
  tests/
    conftest.py
    test_client.py
    test_models.py
    test_handlers.py
  Dockerfile
  pyproject.toml
  .env.example

Running tests

uv run pytest -v

Comparison with yelp-mcp-min (FastMCP)

Aspect

yelp-mcp-min (FastMCP)

yelp-mcp-sdk (official SDK)

Tool registration

@mcp.tool() decorator

list_tools + call_tool dispatcher

Input schema

Auto-generated from func sig

model.model_json_schema() explicit

Output type

Return Pydantic model directly

list[TextContent] with JSON string

Resources

@mcp.resource("uri://...") decorator

list_resource_templates + read_resource pair

Dependency inject

None (captured via closure)

lifespan context → request_context

Transport

mcp.run()

asyncio.run() + stdio_server()

Server LOC

~350

~450

Available Tools

5 tools
find_business_by_phoneA
Read-onlyIdempotent

Look up Yelp businesses that match a phone number. Use when you have a phone number and need to identify the business. Phone must be in E.164 format (+14155551234). Returns up to a handful of candidates; empty list means not found.

ParametersJSON Schema
NameRequiredDescriptionDefault
phoneYesE.164 phone number including country code, e.g. '+14155551234'.

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate read-only and idempotent. Description adds behavioral details: results limited to 'a handful of candidates', empty list means not found. This clarifies nondeterminism and false negatives beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, zero filler. First sentence defines purpose and usage context. Second sentence covers format and output expectations. Every phrase earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 1 parameter and no output schema, description covers all essential aspects: action, usage scenario, input format, and result interpretation. No gaps for agent decision-making.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage 100% and schema already describes phone format thoroughly. Description merely reaffirms format without adding new meaning. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clear verb 'look up' and resource 'Yelp businesses' with specific filter 'phone number'. Differentiates from siblings like 'search_businesses' (generic) or 'get_business' (by ID) by focusing on phone lookup.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

States when to use: 'when you have a phone number and need to identify the business'. Provides format requirement (E.164) and explains return behavior (few candidates, empty if not found). No explicit when-not, but context implies it's the dedicated phone lookup.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_businessA
Read-onlyIdempotent

Fetch the full Yelp profile for a specific business by its ID or alias. Use when you already have a Yelp business ID and need complete details: hours, all photos, full address, price tier, categories, and URL. Raises an error if the business ID does not exist on Yelp.

ParametersJSON Schema
NameRequiredDescriptionDefault
business_idYesYelp business ID or alias, e.g. 'tartine-bakery-san-francisco'. Obtain from search_businesses, find_business_by_phone, or match_business.
localeNoBCP 47 locale, e.g. 'en_US', 'fr_FR'. Defaults to en_US.

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and idempotentHint=true. The description adds that it raises an error if the business ID does not exist on Yelp, which is valuable behavioral detail. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with no waste. First sentence states purpose and scope. Second sentence adds usage guidance and error behavior. Perfectly front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description lists key returned fields (hours, photos, address, price tier, categories, URL), which is sufficient for a read-only data fetch. Could mention that it returns a single object, but not necessary.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% (both parameters have descriptions). The description adds value by specifying the source for business_id ('Obtain from search_businesses, find_business_by_phone, or match_business') and noting the default locale ('en_US').

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the action ('Fetch the full Yelp profile') and the resource ('a specific business by its ID or alias'). It distinguishes from siblings like search_businesses (which searches by query) and find_business_by_phone (by phone number).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says 'Use when you already have a Yelp business ID and need complete details.' This provides clear context. However, it does not explicitly state when not to use it or mention alternatives like search_businesses if the ID is not known.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_business_reviewsA
Read-onlyIdempotent

Retrieve user reviews for a specific Yelp business. Use when the user wants to read customer opinions: ratings, comments, and reviewer info. Returns up to 50 reviews per call. Use offset to paginate; total field shows how many reviews exist.

ParametersJSON Schema
NameRequiredDescriptionDefault
business_idYesYelp business ID or alias. Obtain from search_businesses, find_business_by_phone, or match_business.
localeNoBCP 47 locale to filter by language, e.g. 'en_US'.
sort_byNoSort: 'yelp_sort' (default), 'newest', 'oldest', 'highest_rated', 'lowest_rated'.
limitNoReviews per page (1–50, default 20).
offsetNoZero-based offset for pagination.

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Description adds behavioral context beyond annotations: returns up to 50 reviews, use offset for pagination, total field shows total count. Annotations already indicate readOnly and idempotent, so the description adds useful operational details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three concise sentences with front-loaded purpose, then usage guidance, then behavioral trait. No wasted words; each sentence adds distinct value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, description covers return fields (ratings, comments, reviewer info) and pagination. Mentions total field. Missing default sort or result structure, but overall adequate for a read-only tool with rich schema descriptions.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. Description adds minimal extra meaning: mentions pagination via offset and limit, and that total field exists. Does not elaborate on sort_by or locale beyond what schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states it retrieves user reviews for a specific Yelp business, with details on ratings, comments, and reviewer info. Distinguished from sibling tools like search_businesses or get_business which serve different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says 'Use when the user wants to read customer opinions' and describes return content. Provides pagination limits (up to 50) and offset usage. Does not explicitly mention when not to use, but the sibling context makes it clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

match_businessA
Read-onlyIdempotent

Match a business by name and address to its canonical Yelp listing. Use when you have structured address data and need to verify or enrich it with Yelp data such as ID, rating, hours, and URL. name + address1 + city + state + country are required. Adding zip_code and phone significantly improves match precision.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYesBusiness name, e.g. 'Tartine Bakery'.
address1YesStreet address, e.g. '600 Guerrero St'.
cityYesCity name, e.g. 'San Francisco'.
stateYesISO 3166-2 state/region code, e.g. 'CA'.
countryYesISO 3166-1 alpha-2 country code, e.g. 'US'.
zip_codeNoPostal code. Improves match accuracy.
phoneNoE.164 phone number. Improves match accuracy.
match_thresholdNoMatch strictness: 'NONE', 'DEFAULT', or 'STRICT'.DEFAULT

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare the tool is read-only and idempotent. The description adds behavioral context by listing required fields and noting that optional fields improve match precision, plus the match_threshold parameter. It does not contradict annotations, but it does not explicitly describe behavior on no match or multiple matches.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three sentences: first declares purpose, second provides usage context, third adds parameter guidance. Every sentence is essential and front-loaded, with no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description adequately hints at return fields (ID, rating, hours, URL) and includes match_threshold options. It could improve by clarifying behavior when no match is found, but it remains sufficiently informative for an agent to decide to use the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, so each parameter is documented. The description adds value by grouping required fields and explaining that zip_code and phone improve match precision, which goes beyond the schema's individual descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: 'Match a business by name and address to its canonical Yelp listing.' It specifies the purpose of verification/enrichment and distinguishes itself from sibling tools like search_businesses or get_business by focusing on structured address matching.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says when to use the tool: 'Use when you have structured address data and need to verify or enrich it with Yelp data.' It also notes required and optional fields. However, it does not explicitly state when not to use it or mention alternative tools, leaving room for ambiguity.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_businessesA
Read-only

Search Yelp for businesses matching a term, location, or both. Use when the user wants to discover restaurants, services, or shops. Supports free-text search, geo coordinates, category filters, price tiers, open-now filtering, and pagination via limit/offset. Supply at least one of: location, or both latitude + longitude.

ParametersJSON Schema
NameRequiredDescriptionDefault
termNoSearch term, e.g. 'tacos', 'coffee', 'plumbers'. Omit to browse by location only.
locationNoAddress, neighbourhood, city, or ZIP code. Required unless latitude + longitude are provided.
latitudeNoDecimal latitude. Pair with longitude.
longitudeNoDecimal longitude. Pair with latitude.
radiusNoSearch radius in metres (max 40 000 ≈ 25 miles).
categoriesNoComma-separated Yelp category aliases, e.g. 'restaurants,bars'.
priceNoComma-separated price tiers: '1'=$, '2'=$$, '3'=$$$, '4'=$$$$. Example: '1,2'.
open_nowNoWhen True, only return businesses currently open.
sort_byNoSort order: 'best_match' (default), 'rating', 'review_count', or 'distance'.
limitNoResults per page (1–50, default 20).
offsetNoZero-based offset. Use with limit to paginate: page 2 = offset 20 when limit=20.

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already provide readOnlyHint=true, idempotentHint=false, openWorldHint=true, so the read-only nature is clear. The description adds no extra behavioral details (e.g., rate limits, result variability, pagination quirks) beyond what the schema and annotations convey, but does not contradict them.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is four sentences, front-loads the main action, and every sentence is informative. No redundancy or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 11-parameter search tool with full schema coverage and annotations, the description adequately summarizes the tool's capabilities and constraints. It misses stating the return format, but no output schema exists, so some inference is needed. However, the overall context is sufficient for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description only summarizes available filter types (free-text, geo, categories, price, open-now, pagination) without adding new semantic meaning beyond the detailed schema descriptions for each parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States 'Search Yelp for businesses matching a term, location, or both' with a clear verb+resource. Mentions discovering restaurants, services, shops. Does not explicitly distinguish from siblings like find_business_by_phone or get_business, but the sibling names are self-explanatory and this tool's purpose is clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides context: 'Use when the user wants to discover restaurants, services, or shops.' Also notes requirement for location or lat/lng and lists supported features. However, it does not mention when not to use this tool or provide alternatives among siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updatesv0.1.0
    • First observedfind_business_by_phone
    • First observedget_business
    • First observedget_business_reviews
    • First observedmatch_business
    • First observedsearch_businesses

TDQS

A4.3/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: phone lookup, get full business details, get reviews, match by name/address, and general search. No overlapping functionality, making selection unambiguous.

Naming Consistency5/5

All tools follow a consistent snake_case verb_noun pattern (e.g., find_business_by_phone, get_business, search_businesses), with clear modifiers where needed. No mixing of conventions.

Tool Count5/5

Five tools is well-scoped for a Yelp API wrapper: covering search, matching, detailed lookup, reviews, and phone lookup. It's neither overly sparse nor bloated.

Completeness5/5

The tool set covers the core Yelp use cases—discovery, matching, detailed info, and reviews. There are no obvious gaps for read-only access, as mutations are not part of Yelp's public API.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Enables conversational interactions with Yelp's business data through an MCP server, allowing natural language queries about local businesses, multi-turn conversations, and direct business inquiries powered by Yelp Fusion AI.
    1
    26
    Apache 2.0
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides access to Yelp's business database for searching local businesses, retrieving detailed ratings and reviews, and performing market research through business counts. It enables users to look up businesses by location, category, or phone number using the Yelp Fusion API.
    1
    -
  • F
    license
    A
    quality
    D
    maintenance
    Minimal MCP server for the Yelp Fusion API v3, enabling business search, phone lookup, match, details, and reviews via FastMCP.
    5
    -