Skip to main content
Glama
klauern

MCP YNAB Server

by klauern

get_account_balance

Retrieve the current dollar balance for a specific YNAB account to monitor financial status.

Instructions

Get the current balance of a YNAB account (in dollars).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
account_idYes

Implementation Reference

  • The handler function for the 'get_account_balance' tool. It uses the YNAB API to retrieve the balance of the specified account in dollars, using the first available budget.
    @mcp.tool() async def get_account_balance(account_id: str) -> float: """Get the current balance of a YNAB account (in dollars).""" async with await get_ynab_client() as client: accounts_api = AccountsApi(client) budgets_api = BudgetsApi(client) budgets_response = budgets_api.get_budgets() budget_id = budgets_response.data.budgets[0].id response = accounts_api.get_account_by_id(budget_id, account_id) return float(response.data.account.balance) / 1000
  • The @mcp.tool() decorator registers this function as the 'get_account_balance' MCP tool.
    @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