Skip to main content
Glama
justmytwospence

ynab-mcp

create_scheduled_transaction

Create recurring transactions in YNAB for future dates, automating regular income or expense entries with customizable frequency and details.

Instructions

[1 API call] Create a new scheduled (recurring) transaction. Date must be in the future (up to 5 years).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
budget_idNoBudget ID or 'last-used'last-used
account_idYesAccount ID
dateYesFirst occurrence date (YYYY-MM-DD), must be future
amountYesAmount in dollars (negative for outflows)
frequencyYesHow often the transaction repeats
payee_idNoPayee ID
payee_nameNoPayee name
category_idNoCategory ID (cannot be credit card payment)
memoNoMemo
flag_colorNoFlag color

Implementation Reference

  • Registration of the "create_scheduled_transaction" tool, defining its metadata and input schema.
    server.registerTool("create_scheduled_transaction", {
      title: "Create Scheduled Transaction",
      description: "[1 API call] Create a new scheduled (recurring) transaction. Date must be in the future (up to 5 years).",
      inputSchema: {
        budget_id: z.string().default("last-used").describe("Budget ID or 'last-used'"),
        account_id: z.string().describe("Account ID"),
        date: z.string().describe("First occurrence date (YYYY-MM-DD), must be future"),
        amount: z.number().describe("Amount in dollars (negative for outflows)"),
        frequency: z.enum(FREQUENCIES).describe("How often the transaction repeats"),
        payee_id: z.string().optional().describe("Payee ID"),
        payee_name: z.string().optional().describe("Payee name"),
        category_id: z.string().optional().describe("Category ID (cannot be credit card payment)"),
        memo: z.string().optional().describe("Memo"),
        flag_color: z.enum(FLAG_COLORS).optional().describe("Flag color"),
      },
      annotations: { readOnlyHint: false },
  • Handler implementation for "create_scheduled_transaction", which communicates with the YNAB client API to create the transaction.
    }, async ({ budget_id, account_id, date, amount, frequency, payee_id, payee_name, category_id, memo, flag_color }) => {
      try {
        const response = await getClient().scheduledTransactions.createScheduledTransaction(budget_id, {
          scheduled_transaction: {
            account_id,
            date,
            amount: dollarsToMilliunits(amount),
            frequency,
            payee_id,
            payee_name,
            category_id,
            memo,
            flag_color: flag_color ?? null,
          },
        });
        const t = response.data.scheduled_transaction;
        return textResult(
          `Created scheduled transaction: ${t.date_first} | ${formatCurrency(t.amount)} | ${t.payee_name ?? "No payee"} | ${t.frequency}\nID: ${t.id}`
        );
      } catch (e: any) {
        return errorResult(e.message);
      }
    });

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

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