get_payment
Retrieve a specific payment record by its unique ID. Access payment details from the Eduframe system.
Instructions
Get one payment record
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID of the payment to retrieve |
Implementation Reference
- src/tools/payments.ts:36-52 (handler)Registration and handler for the 'get_payment' tool. Calls API GET /payments/{id} and returns a formatted payment record.
server.registerTool( "get_payment", { description: "Get one payment record", annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, inputSchema: { id: z.number().int().positive().describe("ID of the payment to retrieve") }, }, async ({ id }) => { try { const record = await apiGet<EduframeRecord>(`/payments/${id}`); void logResponse("get_payment", { id }, record); return formatShow(record, "payment"); } catch (error) { return formatError(error); } }, ); - src/tools/payments.ts:40-52 (schema)Input schema for 'get_payment' - requires a positive integer 'id' field with description 'ID of the payment to retrieve'.
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, inputSchema: { id: z.number().int().positive().describe("ID of the payment to retrieve") }, }, async ({ id }) => { try { const record = await apiGet<EduframeRecord>(`/payments/${id}`); void logResponse("get_payment", { id }, record); return formatShow(record, "payment"); } catch (error) { return formatError(error); } }, ); - src/tools/index.ts:128-132 (registration)registerAllTools iterates over all tool registrations including registerPaymentTools which registers 'get_payment'.
export function registerAllTools(server: McpServer): void { for (const register of tools) { register(server); } } - src/tools/index.ts:102-102 (registration)registerPaymentTools is included in the tools array in src/tools/index.ts, which is iterated by registerAllTools.
registerPaymentTools, - src/tools/payments.ts:3-5 (helper)Imports used by the handler: apiGet for HTTP GET, formatShow for response formatting, formatError for error handling, and logResponse for logging.
import { apiDelete, apiGet, apiList, apiPost } from "../api"; import { formatDelete, formatError, formatList, formatShow, type EduframeRecord } from "../formatters"; import { logResponse } from "../response-logger";