Skip to main content
Glama
summarizeTransactions.ts1.6 kB
/** * @file Summarize Transactions Prompt * @version 1.0.0 * @description Implementation of the summarize_transactions prompt for the Brex MCP server */ import { BrexClient } from "../services/brex/client.js"; import { logDebug, logError } from "../utils/logger.js"; // Get Brex client function getBrexClient(): BrexClient { return new BrexClient(); } /** * Implements the summarize_transactions prompt * @returns The prompt messages for summarizing transactions */ export async function summarizeTransactions() { try { const brexClient = getBrexClient(); const accounts = await brexClient.getAccounts(); const embeddedResources = accounts.items.map(account => ({ type: "resource" as const, resource: { uri: `brex://accounts/${account.id}`, mimeType: "application/json", text: JSON.stringify(account, null, 2) } })); return { messages: [ { role: "user", content: { type: "text", text: "Please analyze the following Brex accounts:" } }, ...embeddedResources.map(resource => ({ role: "user" as const, content: resource })), { role: "user", content: { type: "text", text: "Provide a summary of the accounts, including total balances by currency and account status." } } ] }; } catch (error) { logError(`Error in summarize_transactions prompt: ${error instanceof Error ? error.message : String(error)}`); throw error; } }

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