get_invoice
Retrieve an invoice record by providing its unique ID. Access invoice details for management or reference.
Instructions
Get an invoice record
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID of the invoice to retrieve |
Implementation Reference
- src/tools/invoices.ts:41-49 (handler)Handler function for the 'get_invoice' tool. Calls GET /invoices/{id} via apiGet, logs the response, and formats the result using formatShow.
async ({ id }) => { try { const record = await apiGet<EduframeRecord>(`/invoices/${id}`); void logResponse("get_invoice", { id }, record); return formatShow(record, "invoice"); } catch (error) { return formatError(error); } }, - src/tools/invoices.ts:37-39 (schema)Input schema for the 'get_invoice' tool: requires a single 'id' (positive integer) parameter.
description: "Get an invoice record", annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, inputSchema: { id: z.number().int().positive().describe("ID of the invoice to retrieve") }, - src/tools/invoices.ts:34-50 (registration)Registration of the 'get_invoice' tool via server.registerTool in the registerInvoiceTools function.
server.registerTool( "get_invoice", { description: "Get an invoice record", annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, inputSchema: { id: z.number().int().positive().describe("ID of the invoice to retrieve") }, }, async ({ id }) => { try { const record = await apiGet<EduframeRecord>(`/invoices/${id}`); void logResponse("get_invoice", { id }, record); return formatShow(record, "invoice"); } catch (error) { return formatError(error); } }, ); - src/tools/index.ts:91-91 (registration)registerInvoiceTools is included in the central tools array in registerAllTools, which iterates and registers all tool groups.
registerInvoiceTools,