Skip to main content
Glama

get_card_statements_primary

Retrieve complete primary card account statements from Brex financial platform. Use this tool to access full statement objects with pagination controls for financial data analysis.

Instructions

Get complete statements for the primary card account. Returns full statement objects. Example: {"limit":10}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cursorNo
limitNo

Implementation Reference

  • Core execution logic for the 'get_card_statements_primary' tool: validates input, fetches statements from Brex primary card account, and returns JSON-formatted list with pagination metadata.
    registerToolHandler("get_card_statements_primary", async (request: ToolCallRequest) => { try { const params = validateParams(request.params.arguments); const client = getBrexClient(); const resp = await client.getPrimaryCardStatements(params.cursor, params.limit); const items = Array.isArray(resp.items) ? resp.items : []; return { content: [{ type: "text", text: JSON.stringify({ statements: items, meta: { count: items.length, next_cursor: (resp as any).next_cursor || null } }, null, 2) }] }; } catch (error) { logError(`Error in get_card_statements_primary: ${error instanceof Error ? error.message : String(error)}`); throw error; } });
  • TypeScript interface definition and runtime validation function for tool input parameters (cursor and limit).
    interface GetCardStatementsParams { cursor?: string; limit?: number; } function validateParams(input: unknown): GetCardStatementsParams { const raw = (input || {}) as Record<string, unknown>; const out: GetCardStatementsParams = {}; if (raw.cursor !== undefined) out.cursor = String(raw.cursor); if (raw.limit !== undefined) { const n = parseInt(String(raw.limit), 10); if (isNaN(n) || n <= 0 || n > 100) throw new Error("Invalid limit (1..100)"); out.limit = n; } return out; }
  • Registers the tool handler function into the central toolHandlers Map using registerToolHandler.
    export function registerGetCardStatementsPrimary(_server: Server): void { registerToolHandler("get_card_statements_primary", async (request: ToolCallRequest) => { try { const params = validateParams(request.params.arguments); const client = getBrexClient(); const resp = await client.getPrimaryCardStatements(params.cursor, params.limit); const items = Array.isArray(resp.items) ? resp.items : []; return { content: [{ type: "text", text: JSON.stringify({ statements: items, meta: { count: items.length, next_cursor: (resp as any).next_cursor || null } }, null, 2) }] }; } catch (error) { logError(`Error in get_card_statements_primary: ${error instanceof Error ? error.message : String(error)}`); throw error; } }); }
  • Official MCP tool schema (inputSchema) exposed in the listTools handler response.
    name: "get_card_statements_primary", description: "Get complete statements for the primary card account. Returns full statement objects. Example: {\"limit\":10}", inputSchema: { type: "object", properties: { cursor: { type: "string" }, limit: { type: "number" } } }
  • Top-level invocation of the tool registration during server tools setup in registerTools.
    registerGetCardStatementsPrimary(server);

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/crazyrabbitLTC/mcp-brex-server'

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