Skip to main content
Glama
Jtewen

You Need A Budget (YNAB) MCP

by Jtewen

manage-payees

Merge and standardize multiple payee names into a single name to streamline and organize budgeting data in YNAB. Simplify payee management by consolidating duplicates or variants.

Instructions

Merge multiple payee names into a single name. Use this to clean up payee data, for example, by renaming 'STARBUCKS #123' and 'Starbucks Coffee' to just 'Starbucks'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesThe action to perform.
budget_idNoThe ID of the budget. If not provided, the default budget will be used.
nameNoThe new name for the payees. Required for 'rename' action.
payee_idsYesThe IDs of the payees to affect.

Implementation Reference

  • The handler function within handle_call_tool that executes the 'manage-payees' tool logic. It validates the input using ManagePayeesInput, determines the budget ID, and calls ynab_client.update_payees for the 'rename' action.
    elif name == "manage-payees":
        args = ManagePayeesInput.model_validate(arguments or {})
        budget_id = await _get_budget_id(args.model_dump())
    
        if args.action == "rename":
            await ynab_client.update_payees(
                budget_id=budget_id,
                payee_ids=args.payee_ids,
                name=args.name,
            )
            return [
                types.TextContent(
                    type="text",
                    text=f"Successfully renamed {len(args.payee_ids)} payees to '{args.name}'.",
                )
            ]
    elif name == "manage-budgeted-amount":
  • Pydantic model defining the input schema and validation for the 'manage-payees' tool, including action, payee_ids, and name fields.
    class ManagePayeesInput(BudgetIdInput):
        action: ManagePayeesAction = Field(..., description="The action to perform.")
        payee_ids: List[str] = Field(..., description="The IDs of the payees to affect.")
        name: Optional[str] = Field(None, description="The new name for the payees. Required for 'rename' action.")
    
        @model_validator(mode='before')
        @classmethod
        def check_fields_for_action(cls, values):
            action = values.get('action')
            if not action:
                raise ValueError("'action' is a required field.")
    
            if action == 'rename':
                if not values.get('name'):
                    raise ValueError("'name' is required for the 'rename' action.")
            
            return values 
  • Registration of the 'manage-payees' tool in the handle_list_tools function, specifying name, description, and input schema.
    types.Tool(
        name="manage-payees",
        description="Merge multiple payee names into a single name. Use this to clean up payee data, for example, by renaming 'STARBUCKS #123' and 'Starbucks Coffee' to just 'Starbucks'.",
        inputSchema=ManagePayeesInput.model_json_schema(),
    ),
  • Helper method in YNABClient that performs the actual payee renaming by concurrently updating each payee using update_payee.
    async def update_payees(self, budget_id: str, payee_ids: list[str], name: str):
        """Updates multiple payees to the same name."""
        tasks = [self.update_payee(budget_id, payee_id, name) for payee_id in payee_ids]
        await asyncio.gather(*tasks)
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it mentions the merge/rename action, it doesn't disclose important behavioral traits like whether this is a destructive operation (likely yes, since it merges payees), what permissions are required, whether changes are reversible, or what happens to associated transactions. The example helps but leaves critical operational details unspecified.

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 perfectly sized with two sentences: the first states the core functionality, the second provides a concrete example. Every word earns its place, and the information is front-loaded with the primary purpose stated immediately.

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

Completeness3/5

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

For a mutation tool with no annotations and no output schema, the description provides adequate purpose and usage context but lacks critical behavioral information. The example helps, but without disclosure of side effects, permissions, or return values, it leaves significant gaps for an agent trying to use this tool correctly.

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 description coverage is 100%, so the schema already documents all 4 parameters thoroughly. The description adds some context about the purpose ('clean up payee data') and provides an example that illustrates how parameters might be used together, but doesn't add significant semantic value beyond what's already in the schema 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 specific action ('merge multiple payee names into a single name') and resource ('payee data'), with a concrete example that distinguishes it from sibling tools like 'list-payees' or 'lookup-payee-locations'. It goes beyond just restating the tool name to explain the transformation function.

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 provides clear context for when to use this tool ('to clean up payee data') with a helpful example scenario. However, it doesn't explicitly state when NOT to use it or mention alternatives among the sibling tools (like whether 'list-payees' should be used first to identify duplicates).

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