Skip to main content
Glama
klauern

MCP YNAB Server

by klauern

set_preferred_budget_id

Specify which YNAB budget to use for subsequent operations in the MCP YNAB Server by setting a budget ID.

Instructions

Set the preferred YNAB budget ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
budget_idYes

Implementation Reference

  • MCP tool handler for 'set_preferred_budget_id'. Decorated with @mcp.tool() which registers the tool. Delegates to YNABResources helper and returns confirmation.
    @mcp.tool() async def set_preferred_budget_id(budget_id: str) -> str: """Set the preferred YNAB budget ID.""" ynab_resources.set_preferred_budget_id(budget_id) return f"Preferred budget ID set to {budget_id}"
  • Helper method in YNABResources class that sets the preferred budget ID in memory and persists it to a JSON file (actually plain text file). Called by the tool handler.
    def set_preferred_budget_id(self, budget_id: str) -> None: """Set the preferred budget ID.""" self._preferred_budget_id = budget_id with open(PREFERRED_BUDGET_ID_FILE, "w") as f: f.write(budget_id)
  • The @mcp.tool() decorator registers the function as an MCP tool with the name matching the function name 'set_preferred_budget_id'.
    @mcp.tool()

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