get_transaction
Retrieve a specific transaction by its ID to view its full details and status.
Instructions
Get a transaction by ID. GET /transactions/{transactionId}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| transactionId | Yes | Transaction ID (required) |
Implementation Reference
- Handler function that validates input with Zod schema, then calls transactionService.getTransaction to fetch the transaction.
async function handler(client: Client, args: Record<string, unknown> | undefined) { const parsed = schema.safeParse(args); if (!parsed.success) { return errorResult(parsed.error.errors.map((e) => e.message).join("; ")); } return handleToolCall(() => transactionService.getTransaction(client, parsed.data.transactionId) ); } - Zod schema and MCP inputSchema definition for get_transaction tool. Requires transactionId (string).
const schema = z.object({ transactionId: z.string().min(1, "transactionId is required"), }); const definition = { name: "get_transaction", description: "Get a transaction by ID. GET /transactions/{transactionId}.", inputSchema: { type: "object" as const, properties: { transactionId: { type: "string", description: "Transaction ID (required)" }, }, required: ["transactionId"], }, }; - src/tools/transactions/getTransaction.ts:33-36 (registration)Export of the getTransactionTool as a Tool object combining definition and handler.
export const getTransactionTool: Tool = { definition, handler, }; - src/tools/transactions/index.ts:22-24 (registration)Re-export of getTransactionTool from the transactions barrel module.
export { getTransactionTool } from "./getTransaction.js"; export { refundTransactionTool } from "./refundTransaction.js"; export { voidTransactionTool } from "./voidTransaction.js"; - Service function that makes the actual HTTP GET request to /transactions/{transactionId}.
export async function getTransaction( client: Client, transactionId: string ): Promise<unknown> { return client.get<unknown>(`/transactions/${transactionId}`); }