Skip to main content
Glama
dgalarza

YNAB MCP Server

by dgalarza

create_scheduled_transaction

Set up automated recurring transactions for future payments in your YNAB budget by specifying frequency, amount, and start date to maintain consistent financial planning.

Instructions

Create a scheduled transaction (for future/recurring transactions).

Args:
    budget_id: The ID of the budget (use 'last-used' for default budget)
    account_id: The account ID for this scheduled transaction
    date_first: The first date the transaction should occur (YYYY-MM-DD format)
    frequency: Frequency (never, daily, weekly, everyOtherWeek, twiceAMonth, every4Weeks, monthly, everyOtherMonth, every3Months, every4Months, twiceAYear, yearly, everyOtherYear)
    amount: Transaction amount (positive for inflow, negative for outflow)
    payee_name: Name of the payee (optional)
    category_id: Category ID (optional)
    memo: Transaction memo (optional)
    flag_color: Flag color - red, orange, yellow, green, blue, purple (optional)

Returns:
    JSON string with the created scheduled transaction

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
account_idYes
amountYes
budget_idYes
category_idNo
date_firstYes
flag_colorNo
frequencyYes
memoNo
payee_nameNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler and registration for 'create_scheduled_transaction'. Decorated with @mcp.tool(), defines input schema via type hints and docstring, delegates to YNABClient.
    @mcp.tool()
    async def create_scheduled_transaction(
        budget_id: str,
        account_id: str,
        date_first: str,
        frequency: str,
        amount: float,
        payee_name: str = None,
        category_id: str = None,
        memo: str = None,
        flag_color: str = None,
    ) -> str:
        """Create a scheduled transaction (for future/recurring transactions).
    
        Args:
            budget_id: The ID of the budget (use 'last-used' for default budget)
            account_id: The account ID for this scheduled transaction
            date_first: The first date the transaction should occur (YYYY-MM-DD format)
            frequency: Frequency (never, daily, weekly, everyOtherWeek, twiceAMonth, every4Weeks, monthly, everyOtherMonth, every3Months, every4Months, twiceAYear, yearly, everyOtherYear)
            amount: Transaction amount (positive for inflow, negative for outflow)
            payee_name: Name of the payee (optional)
            category_id: Category ID (optional)
            memo: Transaction memo (optional)
            flag_color: Flag color - red, orange, yellow, green, blue, purple (optional)
    
        Returns:
            JSON string with the created scheduled transaction
        """
        client = get_ynab_client()
        result = await client.create_scheduled_transaction(
            budget_id,
            account_id,
            date_first,
            frequency,
            amount,
            payee_name,
            category_id,
            memo,
            flag_color,
        )
        return json.dumps(result, indent=2)
  • Core implementation of scheduled transaction creation in YNABClient class. Constructs API payload and performs POST request to YNAB /scheduled_transactions endpoint.
    async def create_scheduled_transaction(
        self,
        budget_id: str,
        account_id: str,
        date_first: str,
        frequency: str,
        amount: float,
        payee_name: str | None = None,
        category_id: str | None = None,
        memo: str | None = None,
        flag_color: str | None = None,
    ) -> dict[str, Any]:
        """Create a scheduled transaction.
    
        Args:
            budget_id: The budget ID or 'last-used'
            account_id: The account ID
            date_first: The first date the transaction should occur (YYYY-MM-DD)
            frequency: Frequency (never, daily, weekly, everyOtherWeek, twiceAMonth, every4Weeks, monthly, everyOtherMonth, every3Months, every4Months, twiceAYear, yearly, everyOtherYear)
            amount: Transaction amount (positive for inflow, negative for outflow)
            payee_name: Payee name (optional)
            category_id: Category ID (optional)
            memo: Transaction memo (optional)
            flag_color: Flag color (red, orange, yellow, green, blue, purple, optional)
    
        Returns:
            Created scheduled transaction dictionary
        """
        try:
            url = f"{self.api_base_url}/budgets/{budget_id}/scheduled_transactions"
    
            scheduled_transaction_data = {
                "account_id": account_id,
                "date": date_first,
                "frequency": frequency,
                "amount": int(amount * 1000),  # Convert to milliunits
            }
    
            if payee_name is not None:
                scheduled_transaction_data["payee_name"] = payee_name
            if category_id is not None:
                scheduled_transaction_data["category_id"] = category_id
            if memo is not None:
                scheduled_transaction_data["memo"] = memo
            if flag_color is not None:
                scheduled_transaction_data["flag_color"] = flag_color
    
            data = {"scheduled_transaction": scheduled_transaction_data}
    
            result = await self._make_request_with_retry("post", url, json=data)
    
            txn = result["data"]["scheduled_transaction"]
    
            return {
                "id": txn["id"],
                "date_first": txn.get("date_first"),
                "date_next": txn.get("date_next"),
                "frequency": txn.get("frequency"),
                "amount": txn["amount"] / 1000 if txn.get("amount") else 0,
                "memo": txn.get("memo"),
                "flag_color": txn.get("flag_color"),
                "account_id": txn.get("account_id"),
                "payee_name": txn.get("payee_name"),
                "category_id": txn.get("category_id"),
            }
        except Exception as e:
            raise Exception(f"Failed to create scheduled transaction: {e}") from e
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it states this creates a scheduled transaction (implying a write operation), it doesn't disclose important behavioral traits like required permissions, whether the creation is idempotent, rate limits, error handling, or what happens if invalid parameters are provided. The description covers basic functionality but lacks operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, Args, Returns) and uses bullet-like formatting for parameters. While somewhat lengthy due to comprehensive parameter documentation, every sentence earns its place. The purpose statement is front-loaded, and the parameter explanations are efficiently presented.

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 complexity (9 parameters, write operation) and lack of annotations, the description does well by thoroughly documenting parameters and stating the return format. However, with no output schema, it could provide more detail about the JSON structure returned. The description covers most essentials but could benefit from more behavioral context for this mutation tool.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by providing detailed parameter documentation. Each parameter gets clear explanations including format requirements (YYYY-MM-DD), special values ('last-used'), sign conventions (positive/negative amounts), enumerated options for frequency and flag_color, and optional/required status. This adds substantial value beyond the bare schema.

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 tool's purpose with a specific verb ('Create') and resource ('scheduled transaction'), and distinguishes it from siblings by specifying it's for 'future/recurring transactions' (unlike create_transaction which likely handles immediate transactions). The parenthetical clarification adds valuable differentiation.

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 through 'for future/recurring transactions' but doesn't explicitly state when to use this tool versus alternatives like create_transaction or create_split_transaction. No guidance is provided about prerequisites, error conditions, or when-not-to-use scenarios.

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