Skip to main content
Glama
klauern

MCP YNAB Server

by klauern

get_transactions

Retrieve recent transactions for a specific account within a YNAB budget to monitor spending and track financial activity.

Instructions

Get recent transactions for a specific account in a specific budget.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
budget_idYes
account_idYes

Implementation Reference

  • The handler function for the 'get_transactions' MCP tool. It fetches transactions for a specific budget and account using the YNAB API since the 1st of the current month, formats them into a markdown table, and returns the result.
    @mcp.tool()
    async def get_transactions(budget_id: str, account_id: str) -> str:
        """Get recent transactions for a specific account in a specific budget."""
        async with await get_ynab_client() as client:
            transactions_api = TransactionsApi(client)
            all_transactions: List[TransactionDetail] = []
            since_date = datetime.now().replace(day=1).date()
            response = transactions_api.get_transactions_by_account(
                budget_id, account_id, since_date=since_date
            )
            all_transactions.extend(response.data.transactions)
    
            markdown = "# Recent Transactions\n\n"
            if not all_transactions:
                return markdown + "_No recent transactions found._\n"
    
            headers = ["ID", "Date", "Amount", "Payee Name", "Category Name", "Memo"]
            align = ["left", "left", "right", "left", "left", "left"]
            rows = []
    
            for txn in all_transactions:
                amount_str = f"${txn.amount / 1000:,.2f}"
                rows.append(
                    [
                        txn.id,
                        txn.var_date.strftime("%Y-%m-%d"),
                        amount_str,
                        txn.payee_name or "N/A",
                        txn.category_name or "N/A",
                        txn.memo or "",
                    ]
                )
    
            markdown += _build_markdown_table(rows, headers, align)
            return markdown
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral disclosure. It mentions 'recent transactions' which hints at temporal filtering, but doesn't specify what 'recent' means, whether results are paginated, sorted, or limited. No information on permissions, rate limits, or error handling is included.

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 a single, efficient sentence with zero wasted words. It's appropriately sized for a simple retrieval tool and front-loads the core purpose immediately.

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

Completeness2/5

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

For a tool with 2 parameters, 0% schema coverage, no annotations, and no output schema, the description is incomplete. It doesn't explain return values, error conditions, or provide enough context for reliable use. The mention of 'recent' is vague and insufficient for a retrieval operation.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate but adds no parameter-specific information. It mentions 'specific account' and 'specific budget' which map to the two parameters, but provides no details on format, validation, or examples. The description doesn't explain what these IDs represent or how to obtain them.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and the resource 'recent transactions', specifying the scope 'for a specific account in a specific budget'. It distinguishes from siblings like 'get_accounts' or 'get_budgets' by focusing on transactions, but doesn't explicitly differentiate from 'get_transactions_needing_attention' or '_find_transaction_by_id'.

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 is provided on when to use this tool versus alternatives like 'get_transactions_needing_attention' or '_find_transaction_by_id'. The description implies usage for recent transactions in a budget/account context, but lacks explicit when/when-not instructions or prerequisite information.

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

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