Skip to main content
Glama

get_planned_courses_by_course_id

Read-onlyIdempotent

Retrieve all planned course records for a specific course ID, with filters for status, type, date range, and more.

Instructions

Get all planned course records of a single course

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_idYesID of the parent resource
cursorNoCursor for fetching the next page of results
per_pageNoNumber of results per page (default: 25)
searchNoFilter results on search
typeNoFilter results on type
parents_publishedNoFilter results on parents_published
published_publicNoOnly show courses that are published and are either planned or in progress
start_date_fromNoFilter results on start_date_from
start_date_untilNoFilter results on start_date_until
availability_stateNoFilter results on availability_state
statusNoFilter results on status
sortNoSort the results. Can change order by using `<sort_by>:<direction>` where `<direction>` is either `asc` or `desc`

Implementation Reference

  • Async handler function that calls apiList with the course_id and filter params, formats the result, and returns planned course records.
    async ({
      course_id,
      cursor,
      per_page,
      search,
      type,
      parents_published,
      published_public,
      start_date_from,
      start_date_until,
      availability_state,
      status,
      sort,
    }) => {
      try {
        const result = await apiList<EduframeRecord>(`/courses/${course_id}/planned_courses`, {
          cursor,
          per_page,
          search,
          type,
          parents_published,
          published_public,
          start_date_from,
          start_date_until,
          availability_state,
          status,
          sort,
        });
        void logResponse(
          "get_planned_courses_by_course_id",
          {
            course_id,
            cursor,
            per_page,
            search,
            type,
            parents_published,
            published_public,
            start_date_from,
            start_date_until,
            availability_state,
            status,
            sort,
          },
          result,
        );
        const toolResult = formatList(result.records, "planned courses");
        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 the tool: course_id (required), plus optional cursor, per_page, search, type, parents_published, published_public, start_date_from, start_date_until, availability_state, status, and sort parameters.
    {
      description: "Get all planned course records of a single course",
      annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
      inputSchema: {
        course_id: z.number().int().positive().describe("ID of the parent resource"),
        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)"),
        search: z.string().optional().describe("Filter results on search"),
        type: z.enum(["FixedPlannedCourse", "FlexiblePlannedCourse"]).optional().describe("Filter results on type"),
        parents_published: z.enum(["parents_published"]).optional().describe("Filter results on parents_published"),
        published_public: z
          .enum(["published_public"])
          .optional()
          .describe("Only show courses that are published and are either planned or in progress"),
        start_date_from: z.string().optional().describe("Filter results on start_date_from"),
        start_date_until: z.string().optional().describe("Filter results on start_date_until"),
        availability_state: z.enum(["open", "closed"]).optional().describe("Filter results on availability_state"),
        status: z.enum(["planned", "active", "completed", "canceled"]).optional().describe("Filter results on status"),
        sort: z
          .array(z.enum(["start_date:asc", "start_date:desc"]))
          .optional()
          .describe(
            "Sort the results. Can change order by using `<sort_by>:<direction>` where `<direction>` is either `asc` or `desc`",
          ),
      },
  • The tool is registered via server.registerTool() with the name "get_planned_courses_by_course_id" inside the registerPlannedCourseTools function.
    export function registerPlannedCourseTools(server: McpServer): void {
      server.registerTool(
        "get_planned_courses_by_course_id",
  • Import and registration of registerPlannedCourseTools in the central tools index, wired into the registerAllTools function.
    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,
      registerCourseTools,
      registerCreditCategorieTools,
      registerCreditTools,
      registerCustomAssociationTools,
      registerCustomFieldOptionTools,
      registerCustomObjectTools,
      registerCustomRecordTools,
      registerDiscountCodeTools,
      registerEditionDescriptionSectionTools,
      registerEducatorTools,
      registerEmailTools,
      registerEnrollmentTools,
      registerGradeTools,
      registerInvoiceVatTools,
      registerInvoiceTools,
      registerLabelTools,
      registerLeadTools,
      registerMaterialGroupTools,
      registerMaterialTools,
      registerMeetingLocationTools,
      registerMeetingTools,
      registerOrderTools,
      registerOrganizationTools,
      registerPaymentMethodTools,
      registerPaymentOptionTools,
      registerPaymentTools,
      registerPlannedCourseTools,
  • The apiList helper function performs the actual GET request to the API with cursor-based pagination, builds the URL with query params, and returns records with nextCursor.
    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 };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint and idempotentHint, so the description adds no behavioral context. Key traits like pagination (cursor, per_page), filtering, and error handling for invalid course_id are not mentioned. Agent cannot anticipate important behaviors from description alone.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence of 11 words, very concise. It could benefit from a bit more context (e.g., mentioning pagination or filtering capability), but it's not bloated. Earns its place but leaves room for improvement.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (12 parameters, many siblings, no output schema), the description is too sparse. It omits important context like how filters modify the 'all' claim, pagination behavior, and return value structure. Agent would need to infer heavily from schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so all parameters are described. The description adds only a small nuance ('of a single course') that relates to course_id, but this is already clear from the parameter name and description. No additional semantic value beyond schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get'), the resource ('planned course records'), and the scope ('a single course'). The name and description together differentiate from similar sibling tools like get_planned_courses_by_id_and_course_id.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus the many similar siblings (e.g., get_planned_courses_by_id_and_course_id). The description does not mention prerequisites, alternatives, or context for selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/martijnpieters/eduframe-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server