Skip to main content
Glama
justmytwospence

ynab-mcp

List Money Movements

list_money_movements
Read-only

Retrieve all funds transferred between categories in a YNAB budget to track internal money movements and maintain accurate category balances.

Instructions

[1 API call] List all money movements for a budget (funds moved between categories)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
budget_idNoBudget ID or 'last-used'last-used

Implementation Reference

  • The handler implementation for the 'list_money_movements' tool, which fetches data from the YNAB client and formats it as a result.
    server.registerTool("list_money_movements", {
      title: "List Money Movements",
      description: "[1 API call] List all money movements for a budget (funds moved between categories)",
      inputSchema: {
        budget_id: z.string().default("last-used").describe("Budget ID or 'last-used'"),
      },
      annotations: { readOnlyHint: true },
    }, async ({ budget_id }) => {
      try {
        const response = await getMoneyMovementsClient().getMoneyMovements(budget_id);
        const movements = response.data.money_movements;
        if (!movements || movements.length === 0) return textResult("No money movements found.");
        const lines = movements.map((m) => {
          const from = m.from_category_id ?? "Ready to Assign";
          const to = m.to_category_id ?? "Ready to Assign";
          return `- ${formatCurrency(m.amount)}: ${from} -> ${to} [${m.moved_at ?? m.month}] ${m.note ? `(${m.note})` : ""}`;
        });
        return textResult(`Money Movements (${movements.length}):\n${lines.join("\n")}`);
      } catch (e: any) {
        return errorResult(e.message);
      }
    });
  • The registration function that defines the 'list_money_movements' tool (along with others) within the McpServer.
    export function registerMoneyMovementTools(server: McpServer) {
      server.registerTool("list_money_movements", {
        title: "List Money Movements",
        description: "[1 API call] List all money movements for a budget (funds moved between categories)",
        inputSchema: {
          budget_id: z.string().default("last-used").describe("Budget ID or 'last-used'"),
        },
        annotations: { readOnlyHint: true },
      }, async ({ budget_id }) => {
        try {
          const response = await getMoneyMovementsClient().getMoneyMovements(budget_id);
          const movements = response.data.money_movements;
          if (!movements || movements.length === 0) return textResult("No money movements found.");
          const lines = movements.map((m) => {
            const from = m.from_category_id ?? "Ready to Assign";
            const to = m.to_category_id ?? "Ready to Assign";
            return `- ${formatCurrency(m.amount)}: ${from} -> ${to} [${m.moved_at ?? m.month}] ${m.note ? `(${m.note})` : ""}`;
          });
          return textResult(`Money Movements (${movements.length}):\n${lines.join("\n")}`);
        } catch (e: any) {
          return errorResult(e.message);
        }
      });
    
      server.registerTool("get_month_money_movements", {
        title: "Get Month Money Movements",
        description: "[1 API call] Get money movements for a specific month",
        inputSchema: {
          budget_id: z.string().default("last-used").describe("Budget ID or 'last-used'"),
          month: z.string().describe("Month in YYYY-MM-DD format (first of month) or 'current'"),
        },
        annotations: { readOnlyHint: true },
      }, async ({ budget_id, month }) => {
        try {
          const response = await getMoneyMovementsClient().getMoneyMovementsByMonth(budget_id, month);
          const movements = response.data.money_movements;
          if (!movements || movements.length === 0) return textResult(`No money movements found for ${month}.`);
          const lines = movements.map((m) => {
            const from = m.from_category_id ?? "Ready to Assign";
            const to = m.to_category_id ?? "Ready to Assign";
            return `- ${formatCurrency(m.amount)}: ${from} -> ${to} ${m.note ? `(${m.note})` : ""}`;
          });
          return textResult(`Money Movements for ${month} (${movements.length}):\n${lines.join("\n")}`);
        } catch (e: any) {
          return errorResult(e.message);
        }
      });
    
      server.registerTool("list_money_movement_groups", {
        title: "List Money Movement Groups",
        description: "[1 API call] List all money movement groups for a budget",
        inputSchema: {
          budget_id: z.string().default("last-used").describe("Budget ID or 'last-used'"),
        },
        annotations: { readOnlyHint: true },
      }, async ({ budget_id }) => {
        try {
          const response = await getMoneyMovementsClient().getMoneyMovementGroups(budget_id);
          const groups = response.data.money_movement_groups;
          if (!groups || groups.length === 0) return textResult("No money movement groups found.");
          const lines = groups.map((g) =>
            `- ${g.month}: ${g.note ?? "No note"} (Created: ${g.group_created_at}) [ID: ${g.id}]`
          );
          return textResult(`Money Movement Groups (${groups.length}):\n${lines.join("\n")}`);
        } catch (e: any) {
          return errorResult(e.message);
        }
      });
    
      server.registerTool("get_month_money_movement_groups", {
        title: "Get Month Money Movement Groups",
        description: "[1 API call] Get money movement groups for a specific month",
        inputSchema: {
          budget_id: z.string().default("last-used").describe("Budget ID or 'last-used'"),
          month: z.string().describe("Month in YYYY-MM-DD format (first of month) or 'current'"),
        },
        annotations: { readOnlyHint: true },
      }, async ({ budget_id, month }) => {
        try {
          const response = await getMoneyMovementsClient().getMoneyMovementGroupsByMonth(budget_id, month);
          const groups = response.data.money_movement_groups;
          if (!groups || groups.length === 0) return textResult(`No money movement groups found for ${month}.`);
          const lines = groups.map((g) =>
            `- ${g.note ?? "No note"} (Created: ${g.group_created_at}) [ID: ${g.id}]`
          );
          return textResult(`Money Movement Groups for ${month} (${groups.length}):\n${lines.join("\n")}`);
        } catch (e: any) {
          return errorResult(e.message);
        }
      });
    }
Behavior3/5

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

The description adds '[1 API call]' as context, which is useful behavioral information not covered by the annotations (which only indicate readOnlyHint=true). However, it doesn't disclose other traits like rate limits, pagination, error handling, or what 'all money movements' entails (e.g., date ranges, limits). With annotations covering safety, this is adequate but not rich in behavioral detail.

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 extremely concise and front-loaded, consisting of a single sentence that efficiently conveys the core functionality. Every word earns its place, with no redundant or verbose phrasing, making it easy for an agent to parse quickly.

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?

Given the tool's low complexity (1 parameter, read-only, no output schema), the description is minimally complete. It covers the basic purpose and API call count but lacks details on output format, error cases, or usage context. With annotations handling safety, this is adequate but leaves gaps for effective tool invocation.

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 description doesn't add any parameter-specific information beyond what the input schema provides. Since schema description coverage is 100% (the 'budget_id' parameter is fully documented in the schema), the baseline score of 3 applies. No additional semantics are offered in the description.

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

Purpose4/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: 'List all money movements for a budget (funds moved between categories)'. It specifies the verb ('List'), resource ('money movements'), and scope ('for a budget'), making it easy to understand. However, it doesn't explicitly differentiate from sibling tools like 'list_money_movement_groups' or 'get_month_money_movements', which prevents a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'list_money_movement_groups' or 'get_month_money_movements', nor does it specify prerequisites, exclusions, or contextual cues for selection. The agent must infer usage from the name and description alone.

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

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