get_order
Retrieve an order record by its ID to view or process order details.
Instructions
Get an order record
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID of the order to retrieve |
Implementation Reference
- src/tools/orders.ts:55-71 (registration)Registration of the 'get_order' tool with its schema (id input) and handler function that calls apiGet('/orders/{id}') and formats the result.
server.registerTool( "get_order", { description: "Get an order record", annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, inputSchema: { id: z.number().int().positive().describe("ID of the order to retrieve") }, }, async ({ id }) => { try { const record = await apiGet<EduframeRecord>(`/orders/${id}`); void logResponse("get_order", { id }, record); return formatShow(record, "order"); } catch (error) { return formatError(error); } }, ); - src/tools/orders.ts:55-71 (handler)Handler for 'get_order': accepts an 'id' parameter, performs a GET request to /orders/{id} via apiGet, logs the response, and returns the formatted record using formatShow.
server.registerTool( "get_order", { description: "Get an order record", annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, inputSchema: { id: z.number().int().positive().describe("ID of the order to retrieve") }, }, async ({ id }) => { try { const record = await apiGet<EduframeRecord>(`/orders/${id}`); void logResponse("get_order", { id }, record); return formatShow(record, "order"); } catch (error) { return formatError(error); } }, ); - src/tools/orders.ts:56-61 (schema)Input schema for 'get_order': requires a single positive integer 'id' field describing the ID of the order to retrieve.
"get_order", { description: "Get an order record", annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, inputSchema: { id: z.number().int().positive().describe("ID of the order to retrieve") }, }, - src/tools/index.ts:35-35 (registration)Import of registerOrderTools from './orders' which registers the 'get_order' tool along with other order tools.
import { registerOrderTools } from "./orders"; - src/tools/index.ts:98-98 (registration)registerOrderTools is included in the list of tool registration functions called by registerAllTools.
registerOrderTools,