get_planning_locations
Retrieve a paginated list of available planning locations. Use cursor and per_page parameters to control the number of results.
Instructions
Get all locations that are available
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
- src/tools/planning_locations.ts:7-32 (registration)Tool registration and handler for 'get_planning_locations'. Registers the tool with an input schema (cursor, per_page) and the async handler that calls the Eduframe API endpoint '/planning/locations'.
export function registerPlanningLocationTools(server: McpServer): void { server.registerTool( "get_planning_locations", { description: "Get all locations that are available", 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>("/planning/locations", { cursor, per_page }); void logResponse("get_planning_locations", { cursor, per_page }, result); const toolResult = formatList(result.records, "planning locations"); if (result.nextCursor) { toolResult.content.push({ type: "text", text: `\nNext page cursor: ${result.nextCursor}` }); } return toolResult; } catch (error) { return formatError(error); } }, ); } - src/tools/planning_locations.ts:18-30 (handler)The async handler function for 'get_planning_locations'. Calls apiList('/planning/locations', ...), logs the response, and formats the result using formatList.
async ({ cursor, per_page }) => { try { const result = await apiList<EduframeRecord>("/planning/locations", { cursor, per_page }); void logResponse("get_planning_locations", { cursor, per_page }, result); const toolResult = formatList(result.records, "planning locations"); if (result.nextCursor) { toolResult.content.push({ type: "text", text: `\nNext page cursor: ${result.nextCursor}` }); } return toolResult; } catch (error) { return formatError(error); } }, - Input schema definition for 'get_planning_locations'. Accepts optional 'cursor' (string) and 'per_page' (positive integer) parameters with descriptions.
{ description: "Get all locations that are available", 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/index.ts:44-44 (registration)Import of registerPlanningLocationTools in the central tools registry.
import { registerPlanningLocationTools } from "./planning_locations"; - src/tools/index.ts:107-107 (registration)Registration of registerPlanningLocationTools in the tools array that is iterated over in registerAllTools.
registerPlanningLocationTools,