Skip to main content
Glama
jeangnc

YNAB MCP Server

by jeangnc

get_category

Retrieve current month data and details for a specific YNAB budget category to monitor spending and track financial goals.

Instructions

Get detailed information about a specific category including current month data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
budget_idYesThe budget ID
category_idYesThe category ID

Implementation Reference

  • The core handler function in YNABClient that performs the HTTP request to retrieve category details from the YNAB API.
    async getCategory(budgetId: string, categoryId: string) {
      return this.request<{ category: any }>(`/budgets/${budgetId}/categories/${categoryId}`);
    }
  • Zod schema for validating input parameters (budget_id and category_id) used for the get_category tool.
    const CategorySchema = z.object({
      budget_id: z.string().describe("The budget ID"),
      category_id: z.string().describe("The category ID"),
    });
  • src/index.ts:205-216 (registration)
    Tool definition registration in the tools array provided to list_tools request handler, including name, description, and input schema.
    {
      name: "get_category",
      description: "Get detailed information about a specific category including current month data.",
      inputSchema: {
        type: "object" as const,
        properties: {
          budget_id: { type: "string", description: "The budget ID" },
          category_id: { type: "string", description: "The category ID" },
        },
        required: ["budget_id", "category_id"],
      },
    },
  • src/index.ts:343-347 (registration)
    Dispatch and execution logic in the CallToolRequestSchema handler: parses args with CategorySchema and invokes the getCategory handler.
    case "get_category": {
      const { budget_id, category_id } = CategorySchema.parse(args);
      result = await client.getCategory(budget_id, category_id);
      break;
    }

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

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