Skip to main content
Glama
shahlaukik

Money Manager MCP Server

by shahlaukik

transaction_list

Retrieve financial transactions within a specified date range to track spending, monitor cash flow, and analyze financial activity in your money management system.

Instructions

Lists transactions within a date range.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
startDateYesStart date (YYYY-MM-DD)
endDateYesEnd date (YYYY-MM-DD)
mbidYesMoney book ID
assetIdNoOptional: Filter by asset ID

Implementation Reference

  • The core handler function for the transaction_list tool. Validates input using TransactionListInputSchema, calls the Money Manager API /getDataByPeriod endpoint with XML parsing, transforms raw XML response into structured TransactionListResponse including count and array of transactions.
    export async function handleTransactionList(
      httpClient: HttpClient,
      input: unknown,
    ): Promise<TransactionListResponse> {
      const validated = TransactionListInputSchema.parse(input);
    
      const params: Record<string, string | undefined> = {
        startDate: validated.startDate,
        endDate: validated.endDate,
        mbid: validated.mbid,
        assetId: validated.assetId,
      };
    
      const rawResponse = await httpClient.getXml<RawTransactionXmlResponse>(
        "/getDataByPeriod",
        params,
      );
    
      // Handle case where response is empty or dataset is missing/empty
      if (!rawResponse || !rawResponse.dataset) {
        return { count: 0, transactions: [] };
      }
    
      // Handle case where dataset is an empty string (can happen with empty XML elements)
      // When xml2js parses <dataset results="0"></dataset> with ignoreAttrs:true,
      // it returns { dataset: "" } instead of { dataset: { results: "0" } }
      if (typeof rawResponse.dataset === "string") {
        return { count: 0, transactions: [] };
      }
    
      // Parse the XML response
      const count = parseInt(rawResponse.dataset?.results || "0", 10);
      let transactions: Transaction[] = [];
    
      if (rawResponse.dataset?.row) {
        const rows = Array.isArray(rawResponse.dataset.row)
          ? rawResponse.dataset.row
          : [rawResponse.dataset.row];
    
        transactions = rows.map((row: RawTransactionRow) => ({
          id: row.id,
          mbDate: row.mbDate,
          assetId: row.assetId,
          toAssetId: row.toAssetId,
          targetAssetId: row.targetAssetId,
          payType: row.payType,
          mcid: row.mcid,
          mbCategory: row.mbCategory,
          mcscid: row.mcscid,
          subCategory: row.subCategory,
          mbContent: row.mbContent,
          mbCash: parseFloat(row.mbCash) || 0,
          inOutCode: row.inOutCode,
          inOutType: row.inOutType,
          mbDetailContent: row.mbDetailContent,
        }));
      }
    
      return { count, transactions };
    }
  • Zod input validation schema for transaction_list tool defining required startDate, endDate, mbid and optional assetId.
     * Input schema for transaction_list tool
     */
    export const TransactionListInputSchema = z.object({
      startDate: DateSchema,
      endDate: DateSchema,
      mbid: MbidSchema,
      assetId: z.string().optional(),
    });
    
    export type TransactionListInput = z.infer<typeof TransactionListInputSchema>;
  • src/index.ts:47-71 (registration)
    MCP tool registration in the main server file, defining the tool name, description, and JSON schema for listTools response.
      name: "transaction_list",
      description: "Lists transactions within a date range.",
      inputSchema: {
        type: "object" as const,
        properties: {
          startDate: {
            type: "string",
            description: "Start date (YYYY-MM-DD)",
          },
          endDate: {
            type: "string",
            description: "End date (YYYY-MM-DD)",
          },
          mbid: {
            type: "string",
            description: "Money book ID",
          },
          assetId: {
            type: "string",
            description: "Optional: Filter by asset ID",
          },
        },
        required: ["startDate", "endDate", "mbid"],
      },
    },
  • Internal handler registry mapping 'transaction_list' to its handler function for dynamic execution.
    transaction_list: handleTransactionList,
  • TypeScript interface defining the output shape of transaction_list tool response.
    export interface TransactionListResponse {
      count: number;
      transactions: Transaction[];
    }
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. It states it 'Lists transactions' which implies a read-only operation, but doesn't address permissions needed, pagination behavior, rate limits, or what format the list returns. For a tool with 4 parameters and no output schema, this leaves significant behavioral gaps.

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 a single, efficient sentence with zero wasted words. It's appropriately sized for a straightforward listing tool and front-loads the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 4 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what the list returns, how results are formatted, whether there are limits on date ranges, or authentication requirements. The minimal description leaves too many contextual questions unanswered.

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?

Schema description coverage is 100%, so all parameters are documented in the schema. The description mentions 'date range' which aligns with startDate and endDate parameters, but doesn't add meaningful context beyond what the schema already provides about mbid or assetId. Baseline 3 is appropriate when schema does the heavy lifting.

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 verb ('Lists') and resource ('transactions') with scope ('within a date range'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'transaction_create' or 'transaction_update', but the listing function is distinct enough from creation/modification operations.

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 like 'transaction_create' or 'transaction_update'. There's no mention of prerequisites, constraints, or comparative context with other transaction-related tools in the sibling list.

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/shahlaukik/money-manager-mcp'

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