Skip to main content
Glama
Jtewen

You Need A Budget (YNAB) MCP

by Jtewen

list-accounts

Retrieve all accounts linked to a specified budget, enabling users to obtain account IDs for integration with other tools or processes.

Instructions

List all accounts for a given budget. Useful for getting account IDs for other tools.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
budget_idNoThe ID of the budget. If not provided, the default budget will be used.

Implementation Reference

  • The main handler for executing the 'list-accounts' tool. Validates input using ListAccountsInput, determines budget_id, fetches accounts via ynab_client, formats and returns the list.
    elif name == "list-accounts":
        args = ListAccountsInput.model_validate(arguments or {})
        budget_id = await _get_budget_id(args.model_dump())
        accounts = await ynab_client.get_accounts(budget_id=budget_id)
    
        if not accounts:
            return [types.TextContent(type="text", text="No accounts found for this budget.")]
    
        account_list = "\n".join(
            f"- {acc.name} (ID: {acc.id}): {acc.balance / 1000:.2f} (Type: {acc.type})"
            for acc in accounts
        )
        return [
            types.TextContent(
                type="text",
                text=f"Here are the accounts for budget {budget_id}:\n{account_list}",
            )
        ]
  • Pydantic model for the input schema of 'list-accounts' tool. Inherits from BudgetIdInput, allowing optional budget_id.
    class ListAccountsInput(BudgetIdInput):
        pass
  • Base Pydantic model providing the optional budget_id field used by ListAccountsInput schema.
    class BudgetIdInput(BaseModel):
        budget_id: Optional[str] = Field(
            None,
            description="The ID of the budget. If not provided, the default budget will be used.",
        )
  • Registration of the 'list-accounts' tool in the list_tools handler, including name, description, and schema reference.
    types.Tool(
        name="list-accounts",
        description="List all accounts for a given budget. Useful for getting account IDs for other tools.",
        inputSchema=ListAccountsInput.model_json_schema(),
    ),
  • Helper function used by list-accounts handler to resolve the budget_id from input arguments, settings, or default budget.
    async def _get_budget_id(arguments: dict | None) -> str:
        """Gets the budget_id from arguments, settings, or falls back to the default budget."""
        if settings.ynab_default_budget_id:
            return settings.ynab_default_budget_id
    
        if arguments and "budget_id" in arguments and arguments["budget_id"]:
            return arguments["budget_id"]
    
        budget = await ynab_client.get_default_budget()
        return budget.id
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions the tool lists accounts and is useful for getting IDs, but fails to disclose key behavioral traits such as whether it's read-only, if it requires specific permissions, how results are formatted, or any pagination/rate limits. This leaves significant gaps 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 two concise sentences that are front-loaded with the core purpose and followed by a practical usage note. Every sentence earns its place with no wasted words, making it highly efficient and well-structured.

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?

Given the tool's low complexity (one optional parameter, no output schema, no annotations), the description is minimally adequate. It states what the tool does and a use case, but lacks details on behavior, output format, or integration with siblings, leaving room for improvement in completeness.

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 input schema has 100% description coverage, clearly documenting the 'budget_id' parameter with its default behavior. The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline of 3 without compensating or adding 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 ('List all accounts') and the resource ('for a given budget'), which is specific and actionable. However, it doesn't explicitly differentiate from sibling tools like 'list-budgets' or 'list-categories', which would require a 5.

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?

The description provides implied usage by stating it's 'Useful for getting account IDs for other tools,' which suggests a preparatory or lookup role. However, it lacks explicit guidance on when to use this tool versus alternatives like 'lookup-entity-by-id' or how it relates to other list tools, falling short of a higher score.

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