Skip to main content
Glama
Jtewen

You Need A Budget (YNAB) MCP

by Jtewen

lookup-payee-locations

Retrieve geographic locations linked to a payee in your YNAB budget. Use this tool to identify payee-specific locations by budget, payee, or location ID for precise financial tracking.

Instructions

Look up geographic locations associated with a payee.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
budget_idNoThe ID of the budget. If not provided, the default budget will be used.
location_idNoThe ID of a specific payee location to retrieve.
payee_idNoThe ID of a payee to list locations for.

Implementation Reference

  • The handler for executing the 'lookup-payee-locations' tool. Validates arguments, fetches payee locations using ynab_client methods based on provided location_id or payee_id or all, formats and returns the results as text content.
    elif name == "lookup-payee-locations":
        args = LookupPayeeLocationsInput.model_validate(arguments or {})
        budget_id = await _get_budget_id(args.model_dump())
        locations = []
        if args.location_id:
            location = await ynab_client.get_payee_location_by_id(
                budget_id, args.location_id
            )
            locations = [location] if location else []
        elif args.payee_id:
            locations = await ynab_client.get_payee_locations_by_payee(
                budget_id, args.payee_id
            )
        else:
            locations = await ynab_client.get_payee_locations(budget_id)
    
        if not locations:
            return [types.TextContent(type="text", text="No payee locations found.")]
    
        locations_dict = [loc.to_dict() for loc in locations]
        return [
            types.TextContent(
                type="text",
                text=f"Found {len(locations)} payee locations:\n{json.dumps(locations_dict, indent=2, default=str)}",
            )
        ]
  • Pydantic model defining the input schema for the tool, inheriting from BudgetIdInput. Supports optional location_id, payee_id, and budget_id.
    class LookupPayeeLocationsInput(BudgetIdInput):
        location_id: Optional[str] = Field(
            None, description="The ID of a specific payee location to retrieve."
        )
        payee_id: Optional[str] = Field(
            None, description="The ID of a payee to list locations for."
        )
  • Registration of the tool in the list_tools handler, specifying name, description, and input schema reference.
    types.Tool(
        name="lookup-payee-locations",
        description="Look up geographic locations associated with a payee.",
        inputSchema=LookupPayeeLocationsInput.model_json_schema(),
    ),
  • Helper method in YNABClient to fetch payee locations by payee ID, used by the tool handler.
    async def get_payee_locations_by_payee(
        self, budget_id: str, payee_id: str
    ) -> list[ynab.PayeeLocation]:
        response = await self._run_sync(
            self._payee_locations_api.get_payee_locations_by_payee,
            budget_id,
            payee_id,
        )
        return response.data.payee_locations
  • Helper method in YNABClient to fetch all payee locations for a budget, used by the tool handler.
    async def get_payee_locations(self, budget_id: str) -> list[ynab.PayeeLocation]:
        response = await self._run_sync(
            self._payee_locations_api.get_payee_locations, budget_id
        )
        return response.data.payee_locations
  • Helper method in YNABClient to fetch a specific payee location by ID, used by the tool handler.
    async def get_payee_location_by_id(
        self, budget_id: str, payee_location_id: str
    ) -> ynab.PayeeLocation:
        response = await self._run_sync(
            self._payee_locations_api.get_payee_location_by_id,
            budget_id,
            payee_location_id,
        )
        return response.data.payee_location
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'look up' which implies a read-only operation, but doesn't disclose behavioral traits such as whether it returns all locations or filtered results, pagination, error handling, or authentication needs. This is a significant gap for a tool with no annotation coverage.

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 a single, efficient sentence that front-loads the core purpose without unnecessary words. It earns its place by clearly stating the tool's function in a compact form, making it easy to parse.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., list of locations, details), behavioral constraints, or how parameters interact, leaving gaps for a tool with 3 parameters and multiple sibling tools.

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?

The schema description coverage is 100%, with clear documentation for all three parameters (budget_id, location_id, payee_id). The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline of 3 for high schema coverage without compensating value.

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?

The description clearly states the action ('look up') and resource ('geographic locations associated with a payee'), making the purpose immediately understandable. However, it doesn't explicitly differentiate this tool from sibling tools like 'list-payees' or 'lookup-entity-by-id', which might also involve payee-related operations.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'list-payees' and 'lookup-entity-by-id', it's unclear if this tool is for specific location queries, bulk operations, or other contexts, leaving the agent without usage direction.

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

Related 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/Jtewen/ynab-mcp'

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