Skip to main content
Glama
Jtewen

You Need A Budget (YNAB) MCP

by Jtewen

manage-financial-overview

Retrieve, update, or refresh a financial overview including account balances, goals, and context notes. Ideal for budget analysis and management.

Instructions

Get, update, or refresh a high-level financial overview. This is the best starting point for any analysis, providing account balances, goals, and important context notes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesThe action to perform.
budget_idNoThe ID of the budget. If not provided, the default budget will be used.
dataNoThe new data for the section. Required for 'update' action.
sectionNoThe section to update (e.g., 'goals', 'action_items'). Required for 'update' action.

Implementation Reference

  • Executes the tool logic: get current overview from notes, update sections, or refresh with current account balances and categorized budgeted amounts.
    elif name == "manage-financial-overview":
        args = ManageFinancialOverviewInput.model_validate(arguments or {})
        
        if args.action == "get":
            overview = ynab_client.notes.load_overview()
            return [
                types.TextContent(
                    type="text",
                    text=f"Financial Overview (Last Updated: {overview.get('last_updated', 'Never')}):\n\n"
                         f"{json.dumps(overview, indent=2)}",
                )
            ]
        elif args.action == "update":
            ynab_client.notes.update_overview_section(args.section, args.data)
            return [
                types.TextContent(
                    type="text",
                    text=f"Successfully updated the {args.section} section of the financial overview.",
                )
            ]
        elif args.action == "refresh":
            budget_id = await _get_budget_id(args.model_dump())
            accounts = await ynab_client.get_accounts(budget_id=budget_id)
            account_balances = {
                acc.name: acc.balance / 1000
                for acc in accounts
            }
            categories = await ynab_client.get_categories(budget_id=budget_id)
            fixed_bills, discretionary_spending, savings = 0, 0, 0
            for group in categories:
                if "bills" in group.name.lower():
                    fixed_bills = sum(cat.budgeted for cat in group.categories if not cat.hidden)
                elif "wants" in group.name.lower() or "spending" in group.name.lower():
                    discretionary_spending = sum(cat.budgeted for cat in group.categories if not cat.hidden)
                elif "savings" in group.name.lower():
                    savings = sum(cat.budgeted for cat in group.categories if not cat.hidden)
            total_budgeted = fixed_bills + discretionary_spending + savings
            savings_rate = (savings / total_budgeted * 100) if total_budgeted > 0 else 0
            overview = ynab_client.notes.load_overview()
            overview["account_balances"] = account_balances
            overview["monthly_overview"] = {
                "fixed_bills": fixed_bills / 1000,
                "discretionary_spending": discretionary_spending / 1000,
                "savings_rate": savings_rate
            }
            ynab_client.notes.save_overview(overview)
            return [
                types.TextContent(
                    type="text",
                    text="Successfully refreshed the financial overview with latest YNAB data.",
                )
            ]
    elif name == "manage-scheduled-transaction":
  • Pydantic input model with action enum and validation for get/update/refresh operations, inheriting budget_id from BudgetIdInput.
    class ManageFinancialOverviewAction(str, Enum):
        GET = "get"
        UPDATE = "update"
        REFRESH = "refresh"
    
    
    class ManageFinancialOverviewInput(BudgetIdInput):
        action: ManageFinancialOverviewAction = Field(..., description="The action to perform.")
        section: Optional[str] = Field(None, description="The section to update (e.g., 'goals', 'action_items'). Required for 'update' action.")
        data: Optional[dict] = Field(None, description="The new data for the section. Required for 'update' 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 == 'update':
                if not values.get('section') or not values.get('data'):
                    raise ValueError("'section' and 'data' are required for the 'update' action.")
            
            return values
  • Tool registration in the MCP server's list_tools() response, including name, description, and input schema reference.
    types.Tool(
        name="manage-financial-overview",
        description="Get, update, or refresh a high-level financial overview. This is the best starting point for any analysis, providing account balances, goals, and important context notes.",
        inputSchema=ManageFinancialOverviewInput.model_json_schema(),
    ),
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While it mentions the tool can 'update' (implying mutation), it doesn't disclose important behavioral traits like authentication requirements, rate limits, whether updates are destructive, or what happens when actions fail. For a multi-action tool with write capabilities, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately concise with two sentences that efficiently communicate the tool's purpose and usage context. The first sentence states what the tool does, and the second provides valuable guidance about when to use it. There's no wasted verbiage or unnecessary repetition.

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 complexity (multi-action with both read and write operations), lack of annotations, and absence of an output schema, the description is somewhat incomplete. While it covers the basic purpose and usage context well, it doesn't address important behavioral aspects or return values that would be crucial for an agent to use this tool effectively, especially for mutation operations.

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%, so the schema already documents all 4 parameters thoroughly. The description doesn't add any meaningful parameter semantics beyond what's in the schema - it doesn't explain what 'refresh' means versus 'get', or clarify the structure of the 'data' object. This meets the baseline expectation when schema coverage is complete.

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 tool's purpose with specific verbs ('Get, update, or refresh') and resource ('a high-level financial overview'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate this multi-action tool from its siblings like 'list-accounts' or 'list-budgets' which might provide overlapping functionality.

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 good contextual guidance by stating 'This is the best starting point for any analysis,' which helps the agent understand when to use this tool. It doesn't explicitly mention when NOT to use it or name specific alternatives among the siblings, but the context is clear enough for effective decision-making.

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