Skip to main content
Glama
Jtewen

You Need A Budget (YNAB) MCP

by Jtewen

get-month-info

Retrieve detailed budget data for a specific month, including age of money, total amounts budgeted, spent, and available. Use this to assess your financial status before making budget adjustments.

Instructions

Get detailed budget information for a single month, including age of money and total amounts budgeted, spent, and available. Call this to check the monthly budget's status before making changes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
budget_idNoThe ID of the budget. If not provided, the default budget will be used.
monthNoThe month to retrieve in YYYY-MM-DD format. If not provided, all months will be listed.

Implementation Reference

  • The core handler function that executes the 'get-month-info' tool. It validates input using GetMonthInfoInput, resolves the budget ID, fetches either a specific month's details or a list of all months via ynab_client, formats the data, and returns it as text content.
    elif name == "get-month-info":
        args = GetMonthInfoInput.model_validate(arguments or {})
        budget_id = await _get_budget_id(args.model_dump())
    
        if args.month:
            # Get a single month
            month_detail = await ynab_client.get_budget_month(budget_id, args.month)
            result_dict = month_detail.to_dict()
            text_output = f"Details for month {args.month}:\n{json.dumps(result_dict, indent=2, default=str)}"
        else:
            # List all months
            months = await ynab_client.get_budget_months(budget_id)
            month_list = "\n".join(
                f"- Month: {m.month}, Budgeted: {m.budgeted / 1000:.2f}, Activity: {m.activity / 1000:.2f}, To Be Budgeted: {m.to_be_budgeted / 1000:.2f}"
                for m in months
            )
            text_output = f"Available months for budget {budget_id}:\n{month_list}"
    
        return [types.TextContent(type="text", text=text_output)]
  • Pydantic model defining the input schema for the get-month-info tool. Inherits from BudgetIdInput (which provides optional budget_id) and adds an optional 'month' field.
    class GetMonthInfoInput(BudgetIdInput):
        month: Optional[str] = Field(
            None, description="The month to retrieve in YYYY-MM-DD format. If not provided, all months will be listed."
        )
  • Registers the 'get-month-info' tool in the list_tools() handler, specifying its name, description, and input schema derived from GetMonthInfoInput.
    types.Tool(
        name="get-month-info",
        description="Get detailed budget information for a single month, including age of money and total amounts budgeted, spent, and available. Call this to check the monthly budget's status before making changes.",
        inputSchema=GetMonthInfoInput.model_json_schema(),
    ),
  • Base Pydantic model used by GetMonthInfoInput (and many other tools) providing the optional 'budget_id' field.
    class BudgetIdInput(BaseModel):
        budget_id: Optional[str] = Field(
            None,
            description="The ID of the budget. If not provided, the default budget will be used.",
        )
  • Helper function used by get-month-info (and other tools) to resolve the budget_id from input arguments, settings, or by fetching the 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
Behavior3/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. It implies a read-only operation ('Get detailed budget information') and suggests a preparatory use ('before making changes'), but lacks details on permissions, rate limits, error handling, or return format. It adds some context but falls short of fully describing behavioral traits 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 appropriately sized and front-loaded, with two sentences that efficiently convey purpose and usage without waste. Every sentence adds value: the first specifies what the tool does, and the second provides clear usage guidance, making it easy to scan and understand.

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 moderate complexity (2 parameters, no output schema, no annotations), the description is partially complete. It covers purpose and usage well but lacks details on behavioral aspects like return values, error cases, or operational constraints. Without annotations or output schema, more context on what to expect from the tool would improve 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?

Schema description coverage is 100%, so the schema already documents both parameters (budget_id and month) with their descriptions and defaults. The description adds no additional parameter semantics beyond what's in the schema, such as format examples or usage tips, meeting the baseline score when schema does the heavy lifting.

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 ('Get detailed budget information for a single month') and resource ('month'), including key data points like 'age of money' and 'total amounts budgeted, spent, and available'. It distinguishes from siblings by focusing on monthly budget status rather than listing entities (e.g., list-budgets, list-transactions) or managing data (e.g., manage-budgeted-amount).

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

Usage Guidelines5/5

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

The description explicitly states when to use this tool: 'Call this to check the monthly budget's status before making changes.' This provides clear context for usage versus alternatives like manage-budgeted-amount for modifications or list-budgets for overviews, though it doesn't name specific alternatives, the guidance is sufficient for 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