Skip to main content
Glama
dgalarza

YNAB MCP Server

by dgalarza

get_unapproved_transactions

Retrieve transactions pending approval for review and decision-making in your YNAB budget management workflow.

Instructions

Get all unapproved transactions that need review.

Args:
    budget_id: The ID of the budget (use 'last-used' for default budget)

Returns:
    JSON string with list of unapproved transactions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
budget_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler: decorated with @mcp.tool(), fetches unapproved transactions using YNABClient and serializes to JSON string.
    @mcp.tool()
    async def get_unapproved_transactions(budget_id: str) -> str:
        """Get all unapproved transactions that need review.
    
        Args:
            budget_id: The ID of the budget (use 'last-used' for default budget)
    
        Returns:
            JSON string with list of unapproved transactions
        """
        client = get_ynab_client()
        result = await client.get_unapproved_transactions(budget_id)
        return json.dumps(result, indent=2)
  • Core implementation in YNABClient: retrieves all transactions via SDK, filters for unapproved and non-deleted, formats and returns list.
    async def get_unapproved_transactions(self, budget_id: str) -> list[dict[str, Any]]:
        """Get all unapproved transactions.
    
        Args:
            budget_id: The budget ID or 'last-used'
    
        Returns:
            List of unapproved transaction dictionaries
        """
        try:
            response = self.client.transactions.get_transactions(budget_id)
    
            transactions = []
            for txn in response.data.transactions:
                if not txn.approved and not txn.deleted:
                    transactions.append(
                        {
                            "id": txn.id,
                            "date": str(txn.date),
                            "amount": txn.amount / 1000 if txn.amount else 0,
                            "memo": txn.memo,
                            "cleared": txn.cleared,
                            "account_id": txn.account_id,
                            "account_name": txn.account_name,
                            "payee_id": txn.payee_id,
                            "payee_name": txn.payee_name,
                            "category_id": txn.category_id,
                            "category_name": txn.category_name,
                        }
                    )
    
            return transactions
        except Exception as e:
            raise Exception(f"Failed to get unapproved transactions: {e}") from e
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states this is a read operation ('Get'), but doesn't mention any behavioral traits such as permissions required, rate limits, pagination, or what 'unapproved' means in context (e.g., pending approval status). The description lacks details on how the data is returned or any side effects, leaving gaps for a tool that likely involves sensitive financial data.

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 appropriately sized and front-loaded: the first sentence states the core purpose, followed by structured sections for 'Args' and 'Returns' that are clear and efficient. Every sentence adds value without redundancy, making it easy to scan and understand quickly.

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 tool's moderate complexity (1 parameter, no annotations, but with an output schema), the description is fairly complete. It covers the purpose, parameter semantics, and return format ('JSON string with list of unapproved transactions'). Since an output schema exists, the description doesn't need to detail return values further. However, it could improve by addressing behavioral aspects like permissions or data freshness, given the lack of annotations.

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 description adds meaningful context for the single parameter 'budget_id' by explaining its purpose ('The ID of the budget') and providing a usage tip ('use 'last-used' for default budget'). Since schema description coverage is 0% (the schema only has a title 'Budget Id' with no description), this compensates well by clarifying semantics beyond the basic schema, though it could elaborate on format or validation rules.

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 tool's purpose: 'Get all unapproved transactions that need review.' This specifies the verb ('Get'), resource ('unapproved transactions'), and scope ('that need review'). However, it doesn't explicitly differentiate from sibling tools like 'get_transactions' or 'search_transactions' which might also retrieve transactions but with different filters or purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by specifying 'unapproved transactions that need review,' suggesting this tool is for reviewing pending items. However, it doesn't provide explicit guidance on when to use this versus alternatives like 'get_transactions' (which might include all transactions) or 'search_transactions' (which might allow custom filtering). No exclusions or prerequisites are mentioned.

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

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