get_budgets
Retrieve and display all YNAB budgets in Markdown format using the Model Context Protocol for streamlined budget management and organization.
Instructions
List all YNAB budgets in Markdown format.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp_ynab/server.py:364-379 (handler)The handler function for the 'get_budgets' MCP tool. It is decorated with @mcp.tool() for registration and fetches the list of budgets from the YNAB API, formatting them as Markdown.@mcp.tool() async def get_budgets() -> str: """List all YNAB budgets in Markdown format.""" async with await get_ynab_client() as client: budgets_api = BudgetsApi(client) budgets_response = budgets_api.get_budgets() budgets_list = budgets_response.data.budgets markdown = "# YNAB Budgets\n\n" if not budgets_list: markdown += "_No budgets found._" else: for budget in budgets_list: b = budget.to_dict() markdown += f"- **{b.get('name', 'Unnamed Budget')}** (ID: {b.get('id')})\n" return markdown