Skip to main content
Glama
klauern

MCP YNAB Server

by klauern

get_account_balance

Retrieve the current dollar balance for a specific YNAB account to monitor financial status.

Instructions

Get the current balance of a YNAB account (in dollars).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
account_idYes

Implementation Reference

  • The handler function for the 'get_account_balance' tool. It uses the YNAB API to retrieve the balance of the specified account in dollars, using the first available budget.
    @mcp.tool()
    async def get_account_balance(account_id: str) -> float:
        """Get the current balance of a YNAB account (in dollars)."""
        async with await get_ynab_client() as client:
            accounts_api = AccountsApi(client)
            budgets_api = BudgetsApi(client)
            budgets_response = budgets_api.get_budgets()
            budget_id = budgets_response.data.budgets[0].id
    
            response = accounts_api.get_account_by_id(budget_id, account_id)
            return float(response.data.account.balance) / 1000
  • The @mcp.tool() decorator registers this function as the 'get_account_balance' MCP tool.
    @mcp.tool()
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 it's a read operation ('Get'), but doesn't disclose behavioral traits such as authentication requirements, rate limits, error conditions, or what happens if the account_id is invalid. This is a significant gap for a tool with zero 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 with zero waste. It front-loads the purpose clearly and includes essential details like the unit of measurement. Every word earns its place, making it appropriately sized for this simple tool.

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 the complexity (simple read operation), no annotations, no output schema, and low schema coverage, the description is incomplete. It lacks context on usage, behavioral transparency, and parameter details, making it inadequate for reliable agent invocation despite its conciseness.

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 0%, so the description must compensate. It implies the parameter is an account identifier but doesn't add meaning beyond what the schema title ('Account Id') provides. No details on format, source, or constraints are given. Baseline is 3 as it minimally addresses the parameter.

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 verb ('Get') and resource ('current balance of a YNAB account'), specifying the unit ('in dollars'). It distinguishes from siblings like 'get_accounts' (list accounts) and 'get_transactions' (list transactions). However, it doesn't explicitly contrast with all siblings, keeping it at 4 rather than 5.

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?

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't mention if this should be used after identifying an account via 'get_accounts' or if there are prerequisites like setting a budget ID. The description only states what it does, not when to invoke it.

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

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