Skip to main content
Glama
miqui

yelp-mcp-sdk

by miqui

match_business

Read-onlyIdempotent

Match a business by name and address to its canonical Yelp listing. Use to verify or enrich business data with Yelp details like ID, rating, hours, and URL.

Instructions

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.

Input Schema

TableJSON 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

Implementation Reference

  • The actual implementation of the match_business tool handler. It validates arguments via MatchParams, calls the Yelp API 'businesses/matches' endpoint, and returns a JSON response of matched businesses using BusinessDetail model.
    async def _match_business(
        arguments: dict[str, Any],
        client: YelpClient,
    ) -> ToolContent:
        params = MatchParams.model_validate(arguments)
        query: dict[str, object] = params.model_dump(exclude_none=True)
        raw = await client.get("businesses/matches", params=query)
        businesses: list[object] = raw.get("businesses", [])  # type: ignore[assignment]
        results = [BusinessDetail.model_validate(b).model_dump(exclude_none=True) for b in businesses]
        return _json({"businesses": results, "total": len(results)})
  • The MatchParams Pydantic model defining input validation schema for match_business. Required fields: name, address1, city, state, country. Optional: zip_code, phone, match_threshold (default: DEFAULT).
    class MatchParams(BaseModel):
        name: str = Field(..., description="Business name, e.g. 'Tartine Bakery'.")
        address1: str = Field(..., description="Street address, e.g. '600 Guerrero St'.")
        city: str = Field(..., description="City name, e.g. 'San Francisco'.")
        state: str = Field(
            ...,
            description="ISO 3166-2 state/region code, e.g. 'CA'.",
        )
        country: str = Field(
            ...,
            description="ISO 3166-1 alpha-2 country code, e.g. 'US'.",
        )
        zip_code: str | None = Field(
            default=None,
            description="Postal code. Improves match accuracy.",
        )
        phone: str | None = Field(
            default=None,
            description="E.164 phone number. Improves match accuracy.",
        )
        match_threshold: str = Field(
            default="DEFAULT",
            description="Match strictness: 'NONE', 'DEFAULT', or 'STRICT'.",
        )
  • Registration of the 'match_business' tool in the TOOLS catalogue. Sets description, associates MatchParams schema, and marks it as idempotent.
    _tool(
        "match_business",
        (
            "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."
        ),
        MatchParams,
        idempotent=True,
    ),
  • BusinessDetail output model used by match_business (and get_business) to deserialize the Yelp API response into structured data.
    class BusinessDetail(_YelpBase):
        """Full business record returned by get_business and match_business."""
    
        id: str
        name: str
        url: str | None = None
        phone: str | None = None
        display_phone: str | None = None
        rating: float | None = None
        review_count: int | None = None
        price: str | None = None
        is_closed: bool = False
        location: Location | None = None
        categories: list[Category] = Field(default_factory=list)
        coordinates: Coordinates | None = None
        image_url: str | None = None
        photos: list[str] = Field(default_factory=list)
        hours: list[Hours] = Field(default_factory=list)
        alias: str | None = None
  • Helper _json function used by _match_business to serialize the response as JSON text content.
    def _json(data: object) -> ToolContent:
        return [types.TextContent(type="text", text=json.dumps(data, indent=2))]
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.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/miqui/yelp-mcp-sdk'

If you have feedback or need assistance with the MCP directory API, please join our Discord server