get_edition_description_sections
Retrieve all edition description sections with optional pagination using cursor and per_page parameters.
Instructions
Get all edition description section records
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cursor | No | Cursor for fetching the next page of results | |
| per_page | No | Number of results per page (default: 25) |
Implementation Reference
- The handler function for the get_edition_description_sections tool. Calls the API to list edition description sections and formats the result.
async ({ cursor, per_page }) => { try { const result = await apiList<EduframeRecord>("/edition_description_sections", { cursor, per_page }); void logResponse("get_edition_description_sections", { cursor, per_page }, result); const toolResult = formatList(result.records, "edition description sections"); if (result.nextCursor) { toolResult.content.push({ type: "text", text: `\nNext page cursor: ${result.nextCursor}` }); } return toolResult; } catch (error) { return formatError(error); } }, - Input schema defining optional 'cursor' (string) and 'per_page' (positive integer) parameters for pagination.
{ description: "Get all edition description section records", annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, inputSchema: { cursor: z.string().optional().describe("Cursor for fetching the next page of results"), per_page: z.number().int().positive().optional().describe("Number of results per page (default: 25)"), }, - src/tools/edition_description_sections.ts:7-32 (registration)Registration function registerEditionDescriptionSectionTools that registers the tool on the MCP server with its schema and handler.
export function registerEditionDescriptionSectionTools(server: McpServer): void { server.registerTool( "get_edition_description_sections", { description: "Get all edition description section records", annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, inputSchema: { cursor: z.string().optional().describe("Cursor for fetching the next page of results"), per_page: z.number().int().positive().optional().describe("Number of results per page (default: 25)"), }, }, async ({ cursor, per_page }) => { try { const result = await apiList<EduframeRecord>("/edition_description_sections", { cursor, per_page }); void logResponse("get_edition_description_sections", { cursor, per_page }, result); const toolResult = formatList(result.records, "edition description sections"); if (result.nextCursor) { toolResult.content.push({ type: "text", text: `\nNext page cursor: ${result.nextCursor}` }); } return toolResult; } catch (error) { return formatError(error); } }, ); } - src/tools/index.ts:22-22 (registration)Import of registerEditionDescriptionSectionTools in the central tools index.
import { registerEditionDescriptionSectionTools } from "./edition_description_sections"; - src/tools/index.ts:85-85 (registration)Registration of registerEditionDescriptionSectionTools in the tools array called by registerAllTools.
registerEditionDescriptionSectionTools,