Skip to main content
Glama
justmytwospence

ynab-mcp

create_category

Add a new budget category with name, group, goal targets, and notes to organize your finances in YNAB.

Instructions

[1 API call] Create a new category in a budget

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
budget_idNoBudget ID or 'last-used'last-used
nameYesCategory name
category_group_idYesID of the category group to add this category to
noteNoCategory note
goal_targetNoGoal target amount in dollars
goal_target_dateNoGoal target date (YYYY-MM-DD)

Implementation Reference

  • The "create_category" tool definition and handler implementation.
    server.registerTool("create_category", {
      title: "Create Category",
      description: "[1 API call] Create a new category in a budget",
      inputSchema: {
        budget_id: z.string().default("last-used").describe("Budget ID or 'last-used'"),
        name: z.string().describe("Category name"),
        category_group_id: z.string().describe("ID of the category group to add this category to"),
        note: z.string().optional().describe("Category note"),
        goal_target: z.number().optional().describe("Goal target amount in dollars"),
        goal_target_date: z.string().optional().describe("Goal target date (YYYY-MM-DD)"),
      },
      annotations: { readOnlyHint: false },
    }, async ({ budget_id, name, category_group_id, note, goal_target, goal_target_date }) => {
      try {
        const response = await getClient().categories.createCategory(budget_id, {
          category: {
            name,
            category_group_id,
            note,
            goal_target: goal_target != null ? dollarsToMilliunits(goal_target) : undefined,
            goal_target_date,
          },
        });
        const c = response.data.category;
        return textResult(`Created category "${c.name}"\nID: ${c.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