Skip to main content
Glama
miqui

yelp-mcp-sdk

by miqui

get_business

Read-onlyIdempotent

Retrieve the complete Yelp profile for a specific business by ID or alias. Access hours, photos, address, price tier, categories, and URL.

Instructions

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.

Input Schema

TableJSON 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.

Implementation Reference

  • The actual handler function for the get_business tool. Validates input (GetBusinessParams), optionally adds locale, calls Yelp API GET /businesses/{id}, validates the response as BusinessDetail, and returns JSON.
    async def _get_business(
        arguments: dict[str, Any],
        client: YelpClient,
    ) -> ToolContent:
        params = GetBusinessParams.model_validate(arguments)
        query: dict[str, object] = {}
        if params.locale:
            query["locale"] = params.locale
        raw = await client.get(
            f"businesses/{params.business_id}",
            params=query or None,
        )
        detail = BusinessDetail.model_validate(raw)
        return _json(detail.model_dump(exclude_none=True))
  • Input schema (Pydantic model) for get_business. Defines required business_id and optional locale fields with descriptions.
    class GetBusinessParams(BaseModel):
        business_id: str = Field(
            ...,
            description=(
                "Yelp business ID or alias, e.g. 'tartine-bakery-san-francisco'. "
                "Obtain from search_businesses, find_business_by_phone, or match_business."
            ),
        )
        locale: str | None = Field(
            default=None,
            description="BCP 47 locale, e.g. 'en_US', 'fr_FR'. Defaults to en_US.",
        )
  • Output schema for get_business (and match_business). Defines the full business detail record returned from the Yelp API.
    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
  • Tool registration entry listing get_business in the TOOLS catalogue with description, input schema, and idempotent annotation.
    _tool(
        "get_business",
        (
            "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."
        ),
        GetBusinessParams,
        idempotent=True,
    ),
  • Dispatch in call_tool handler that routes get_business calls to _get_business.
    if name == "get_business":
        return await _get_business(arguments, client)
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.

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