get_course_tabs
Retrieve all course tab records with pagination. Use cursor for next page and per_page to limit results.
Instructions
Get all course tab 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
- src/tools/course_tabs.ts:7-32 (handler)The registerCourseTabTools function registers the 'get_course_tabs' tool on the MCP server. The handler (lines 18-30) calls apiList<EduframeRecord>('/course_tabs', ...) to fetch paginated course tab records from the Eduframe API, logs the response, formats the result, and returns it with an optional next cursor.
export function registerCourseTabTools(server: McpServer): void { server.registerTool( "get_course_tabs", { description: "Get all course tab 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>("/course_tabs", { cursor, per_page }); void logResponse("get_course_tabs", { cursor, per_page }, result); const toolResult = formatList(result.records, "course tabs"); if (result.nextCursor) { toolResult.content.push({ type: "text", text: `\nNext page cursor: ${result.nextCursor}` }); } return toolResult; } catch (error) { return formatError(error); } }, ); } - src/tools/course_tabs.ts:10-16 (schema)Input schema for 'get_course_tabs' tool: defines optional 'cursor' (string, for pagination) and 'per_page' (positive integer, default 25) parameters using Zod.
{ description: "Get all course tab 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/course_tabs.ts:8-31 (registration)Registration of the tool via server.registerTool() with the name 'get_course_tabs', description, annotations (readOnlyHint: true), input schema, and handler callback.
server.registerTool( "get_course_tabs", { description: "Get all course tab 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>("/course_tabs", { cursor, per_page }); void logResponse("get_course_tabs", { cursor, per_page }, result); const toolResult = formatList(result.records, "course tabs"); 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:12-76 (registration)Import and inclusion of registerCourseTabTools in the tools array (line 75) which gets called by registerAllTools to register all tools on the MCP server.
import { registerCourseTabTools } from "./course_tabs"; import { registerCourseVariantTools } from "./course_variants"; import { registerCourseTools } from "./courses"; import { registerCreditCategorieTools } from "./credit_categories"; import { registerCreditTools } from "./credits"; import { registerCustomAssociationTools } from "./custom_associations"; import { registerCustomFieldOptionTools } from "./custom_field_options"; import { registerCustomObjectTools } from "./custom_objects"; import { registerCustomRecordTools } from "./custom_records"; import { registerDiscountCodeTools } from "./discount_codes"; import { registerEditionDescriptionSectionTools } from "./edition_description_sections"; import { registerEducatorTools } from "./educators"; import { registerEmailTools } from "./emails"; import { registerEnrollmentTools } from "./enrollments"; import { registerGradeTools } from "./grades"; import { registerInvoiceVatTools } from "./invoice_vats"; import { registerInvoiceTools } from "./invoices"; import { registerLabelTools } from "./labels"; import { registerLeadTools } from "./leads"; import { registerMaterialGroupTools } from "./material_groups"; import { registerMaterialTools } from "./materials"; import { registerMeetingLocationTools } from "./meeting_locations"; import { registerMeetingTools } from "./meetings"; import { registerOrderTools } from "./orders"; import { registerOrganizationTools } from "./organizations"; import { registerPaymentMethodTools } from "./payment_methods"; import { registerPaymentOptionTools } from "./payment_options"; import { registerPaymentTools } from "./payments"; import { registerPlannedCourseTools } from "./planned_courses"; import { registerPlanningAttendeeTools } from "./planning_attendees"; import { registerPlanningConflictTools } from "./planning_conflicts"; import { registerPlanningEventTools } from "./planning_events"; import { registerPlanningLocationTools } from "./planning_locations"; import { registerPlanningMaterialTools } from "./planning_materials"; import { registerPlanningRequiredTeacherGroupAttendeeTools } from "./planning_required_teacher_group_attendees"; import { registerPlanningTeacherTools } from "./planning_teachers"; import { registerProgramEditionTools } from "./program_editions"; import { registerProgramElementTools } from "./program_elements"; import { registerProgramEnrollmentTools } from "./program_enrollments"; import { registerProgramPersonalProgramElementTools } from "./program_personal_program_elements"; import { registerProgramProgramTools } from "./program_programs"; import { registerReferralTools } from "./referrals"; import { registerSignupQuestionTools } from "./signup_questions"; import { registerTaskTools } from "./tasks"; import { registerTeacherEnrollmentTools } from "./teacher_enrollments"; import { registerTeacherRoleTools } from "./teacher_roles"; import { registerTeacherTools } from "./teachers"; import { registerTheseTools } from "./theses"; import { registerUserTools } from "./users"; import { registerWebhookNotificationTools } from "./webhook_notifications"; import { registerWebhookTools } from "./webhooks"; const tools: Array<(server: McpServer) => void> = [ registerAccountTools, registerAffiliationTools, registerAttendanceTools, registerAuthenticationTools, registerCatalogProductTools, registerCatalogVariantTools, registerCategorieTools, registerCertificateTools, registerCommentTools, registerCourseLocationTools, registerCourseTabTools, registerCourseVariantTools, - src/api.ts:122-137 (helper)The apiList<T>() helper function used by the handler: performs a GET request to the Eduframe API, parses paginated JSON results and extracts the next cursor from the Link header.
export async function apiList<T>(path: string, query?: Record<string, QueryValue>): Promise<ListResult<T>> { const { token } = getConfig(); const url = buildUrl(path, query); const response = await fetch(url.toString(), { method: "GET", headers: buildHeaders(token), }); await checkResponse(response); const records = (await response.json()) as T[]; const nextCursor = parseNextCursor(response.headers.get("Link")); return { records, nextCursor }; }