Skip to main content
Glama
Jtewen

You Need A Budget (YNAB) MCP

by Jtewen

manage-scheduled-transaction

Create, update, or delete recurring transactions like bills or savings transfers to manage automated financial workflows efficiently.

Instructions

Create, update, or delete a single scheduled (recurring) transaction. Use this to manage recurring bills or savings transfers.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesThe action to perform.
budget_idNoThe ID of the budget. If not provided, the default budget will be used.
transaction_dataNoThe data for the scheduled transaction to create or update.
transaction_idNoThe ID of the scheduled transaction to update or delete.

Implementation Reference

  • The core handler function within the @server.call_tool() decorator that processes the tool call, validates arguments using ManageScheduledTransactionInput, extracts budget_id, and executes create, update, or delete actions via ynab_client.
    elif name == "manage-scheduled-transaction":
        args = ManageScheduledTransactionInput.model_validate(arguments or {})
        budget_id = await _get_budget_id(args.model_dump())
    
        action = args.action
        if action == "create":
            transaction_data = {
                k: v for k, v in args.transaction_data.model_dump().items() if v is not None
            }
            if "amount" in transaction_data:
                transaction_data["amount"] = int(transaction_data["amount"])
            
            await ynab_client.create_scheduled_transaction(
                budget_id=budget_id, transaction=SaveScheduledTransaction(**transaction_data)
            )
            return [
                types.TextContent(
                    type="text",
                    text="Successfully created scheduled transaction.",
                )
            ]
        elif action == "update":
            transaction_data = {
                k: v for k, v in args.transaction_data.model_dump().items() if v is not None
            }
            if "amount" in transaction_data:
                transaction_data["amount"] = int(transaction_data["amount"])
    
            await ynab_client.update_scheduled_transaction(
                budget_id=budget_id,
                transaction_id=args.transaction_id,
                transaction=SaveScheduledTransaction(**transaction_data),
            )
            return [
                types.TextContent(
                    type="text",
                    text=f"Successfully updated scheduled transaction {args.transaction_id}.",
                )
            ]
        elif action == "delete":
            await ynab_client.delete_scheduled_transaction(
                budget_id=budget_id, transaction_id=args.transaction_id
            )
            return [
                types.TextContent(
                    type="text",
                    text=f"Successfully deleted scheduled transaction {args.transaction_id}.",
                )
            ]
  • Pydantic model for input validation and schema definition used in tool registration and handler. Includes action enum reference, fields for id and data, and model validators for action-specific requirements.
    class ManageScheduledTransactionInput(BudgetIdInput):
        action: ManageScheduledTransactionAction = Field(..., description="The action to perform.")
        transaction_id: Optional[str] = Field(None, description="The ID of the scheduled transaction to update or delete.")
        transaction_data: Optional[ScheduledTransaction] = Field(None, description="The data for the scheduled transaction to create or update.")
    
        @model_validator(mode='before')
        @classmethod
        def check_fields_for_action(cls, values):
            action = values.get('action')
            if not action:
                raise ValueError("'action' is a required field.")
    
            transaction_id = values.get('transaction_id')
            transaction_data = values.get('transaction_data')
    
            if action == 'create':
                if not transaction_data:
                    raise ValueError("'transaction_data' is required for the 'create' action.")
                if transaction_id:
                    raise ValueError("'transaction_id' should not be provided for the 'create' action.")
            elif action == 'update':
                if not transaction_id or not transaction_data:
                    raise ValueError("'transaction_id' and 'transaction_data' are required for the 'update' action.")
            elif action == 'delete':
                if not transaction_id:
                    raise ValueError("'transaction_id' is required for the 'delete' action.")
                if transaction_data:
                    raise ValueError("'transaction_data' should not be provided for the 'delete' action.")
            
            return values
  • Nested Pydantic model defining the structure of the scheduled transaction data used in create/update actions.
    class ScheduledTransaction(BaseModel):
        account_id: str = Field(..., description="The ID of the account for the transaction.")
        date: str = Field(..., description="The transaction date in YYYY-MM-DD format.")
        amount: float = Field(..., description="The transaction amount in milliunits.")
        frequency: str = Field(..., description="The frequency of the scheduled transaction (e.g. 'daily', 'weekly', 'monthly').")
        payee_id: Optional[str] = Field(None, description="The ID of the payee.")
        payee_name: Optional[str] = Field(
            None, description="The name of the payee. If not provided, a new payee will be created."
        )
        category_id: Optional[str] = Field(
            None, description="The ID of the category for the transaction."
        )
        memo: Optional[str] = Field(None, description="A memo for the transaction.")
        flag_color: Optional[str] = Field(
            None, description="The flag color of the transaction.",
        )
        import_id: Optional[str] = Field(
            None, description="A unique import ID for the transaction. Use for idempotency."
        )
  • Tool registration in the @server.list_tools() handler, defining name, description, and input schema reference.
    types.Tool(
        name="manage-scheduled-transaction",
        description="Create, update, or delete a single scheduled (recurring) transaction. Use this to manage recurring bills or savings transfers.",
        inputSchema=ManageScheduledTransactionInput.model_json_schema(),
  • Supporting methods in YNABClient class that wrap the YNAB SDK API calls for creating, updating, and deleting scheduled transactions, invoked by the tool handler.
    async def create_scheduled_transaction(
        self, budget_id: str, transaction: SaveScheduledTransaction
    ):
        wrapper = PostScheduledTransactionWrapper(scheduled_transaction=transaction)
        return await self._run_sync(
            self._scheduled_transactions_api.create_scheduled_transaction,
            budget_id,
            wrapper,
        )
    
    async def update_scheduled_transaction(
        self, budget_id: str, transaction_id: str, transaction: SaveScheduledTransaction
    ):
        wrapper = PutScheduledTransactionWrapper(scheduled_transaction=transaction)
        return await self._run_sync(
            self._scheduled_transactions_api.update_scheduled_transaction,
            budget_id,
            transaction_id,
            wrapper,
        )
    
    async def delete_scheduled_transaction(self, budget_id: str, transaction_id: str):
        return await self._run_sync(
            self._scheduled_transactions_api.delete_scheduled_transaction,
            budget_id,
            transaction_id,
        )
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While it mentions the three actions (create, update, delete), it doesn't address important behavioral aspects like authentication requirements, error conditions, whether deletions are permanent, what happens with conflicting transactions, or rate limits. For a mutation tool with zero annotation coverage, this is a significant gap.

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 perfectly concise with two sentences that each earn their place. The first sentence states the core functionality, and the second provides usage context. There's zero wasted language, and it's appropriately front-loaded with the essential information.

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

Completeness3/5

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

For a mutation tool with no annotations and no output schema, the description provides adequate but incomplete context. It clearly states what the tool does and when to use it, but lacks behavioral details about permissions, side effects, and error handling. The high schema coverage helps, but for a tool that can delete data, more behavioral transparency would be beneficial.

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

Parameters3/5

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

The schema description coverage is 100%, so the schema already documents all four parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema. According to the scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no parameter information in the description.

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

Purpose5/5

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

The description clearly states the specific actions (create, update, delete) and resource (scheduled transaction) with concrete examples (recurring bills or savings transfers). It distinguishes this single-transaction tool from the sibling 'bulk-manage-transactions' tool by emphasizing 'a single scheduled transaction.'

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool ('to manage recurring bills or savings transfers') and implicitly distinguishes it from bulk operations by specifying 'a single scheduled transaction.' However, it doesn't explicitly state when NOT to use it or name specific alternatives beyond the implied contrast with bulk operations.

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

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

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