Skip to main content
Glama
WGDevelopment

YNAB MCP Server

ynab_get_budgets

Read-onlyIdempotent

List all budgets available to the authenticated YNAB user, allowing AI assistants to access and manage budget data from a personal finance application.

Instructions

List all budgets available to the authenticated user.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool registration for 'ynab_get_budgets' - decorator registering the tool with FastMCP, including annotations for readOnly/destructive/idempotent hints.
    @mcp.tool(
        name="ynab_get_budgets",
        annotations={
            "title": "List YNAB Budgets",
            "readOnlyHint": True,
            "destructiveHint": False,
            "idempotentHint": True,
            "openWorldHint": False,
        }
  • Handler function that executes the 'ynab_get_budgets' tool logic: creates a YNABClient, calls get_budgets(), formats results as markdown, and returns the formatted string.
    async def ynab_get_budgets(params: GetBudgetsInput) -> str:
        """List all budgets available to the authenticated user."""
        try:
            async with YNABClient() as client:
                budgets = await client.get_budgets()
            
            result = "## Your YNAB Budgets\n\n"
            for b in budgets:
                result += f"- **{b['name']}**\n"
                result += f"  - ID: `{b['id']}`\n"
                result += f"  - Last modified: {b.get('last_modified_on', 'N/A')}\n\n"
            
            return result
        except Exception as e:
            return format_error(e)
  • Input schema for the tool - an empty Pydantic model (no parameters needed) with whitespace stripping config.
    class GetBudgetsInput(BaseModel):
        """Input for listing all budgets."""
        model_config = ConfigDict(str_strip_whitespace=True)
  • API client helper that makes the actual HTTP GET request to YNAB API /budgets endpoint and returns the list of budgets.
    async def get_budgets(self) -> List[Dict[str, Any]]:
        """Get all budgets for the authenticated user."""
        response = await self._request("GET", "/budgets")
        return response["data"]["budgets"]
Behavior3/5

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

Annotations already provide readOnlyHint and idempotentHint, so the description does not need to repeat them. However, it adds no additional behavioral context beyond the annotations.

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 a single short sentence, which is concise but could be slightly more structured (e.g., hint at return value). Still effective.

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

Completeness4/5

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

Given the output schema exists (context confirms), the description does not need to explain return values. The tool is simple and low-complexity, and the description is sufficiently complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has no real parameters (the single params object contains no properties), so the description does not need to add parameter semantics. Baseline for 0 effective parameters is 4.

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 uses the specific verb 'List' and resource 'budgets', clearly distinguishing it from sibling tools like ynab_create_transaction and ynab_get_accounts.

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 on when to use this tool versus alternatives, such as ynab_get_accounts or others. No exclusions or context provided.

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

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