Skip to main content
Glama

create_teacher_enrollment_by_planned_course_id

Idempotent

Assign a teacher to a planned course by providing the course ID and teacher ID, with an optional role. Automates teacher enrollment.

Instructions

Enroll a teacher to the given planned course.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
planned_course_idYesID of the teacher enrollment
teacher_idYesUnique identifier of the teacher.
teacher_role_idNoUnique identifier of the teacher role.

Implementation Reference

  • Handler for the 'create_teacher_enrollment_by_planned_course_id' tool. Registers via server.registerTool, posts to /planned_courses/{planned_course_id}/teacher_enrollments via apiPost, and uses formatShow to return the result.
    server.registerTool(
      "create_teacher_enrollment_by_planned_course_id",
      {
        description: "Enroll a teacher to the given planned course.",
        annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
        inputSchema: {
          planned_course_id: z.number().int().positive().describe("ID of the teacher enrollment"),
          teacher_id: z.number().int().describe("Unique identifier of the teacher."),
          teacher_role_id: z.number().int().optional().describe("Unique identifier of the teacher role."),
        },
      },
      async ({ planned_course_id, ...body }) => {
        try {
          const record = await apiPost<EduframeRecord>(`/planned_courses/${planned_course_id}/teacher_enrollments`, body);
          void logResponse("create_teacher_enrollment_by_planned_course_id", { planned_course_id, ...body }, record);
          return formatShow(record, "teacher enrollment");
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • Input schema definition: expected parameters are planned_course_id (required positive int), teacher_id (required int), and teacher_role_id (optional int).
    inputSchema: {
      planned_course_id: z.number().int().positive().describe("ID of the teacher enrollment"),
      teacher_id: z.number().int().describe("Unique identifier of the teacher."),
      teacher_role_id: z.number().int().optional().describe("Unique identifier of the teacher role."),
    },
  • Tool registration name: 'create_teacher_enrollment_by_planned_course_id' passed as first argument to server.registerTool.
    "create_teacher_enrollment_by_planned_course_id",
  • Registration wiring: registerTeacherEnrollmentTools is imported from ./teacher_enrollments and included in the tools array that registerAllTools iterates over.
    import { registerTeacherEnrollmentTools } from "./teacher_enrollments";
  • formatShow helper used by the handler to format the created teacher enrollment record as a text/CallToolResult response.
    export function formatShow(record: EduframeRecord, resourceName: string): CallToolResult {
      return {
        content: [
          {
            type: "text",
            text: `${resourceName}:\n\n${formatJSON(record)}${RESPONSE_LOG_HINT}`,
          },
        ],
      };
    }
Behavior3/5

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

Annotations already declare the tool as non-read, non-destructive, and idempotent. The description adds no further behavioral context (e.g., side effects, idempotency implications, or success/failure behavior). It does not contradict annotations, but it also does not enhance them.

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, clear sentence—no wasted words. It effectively front-loads the core action. However, it is slightly under-specified; additional details could be included without harming conciseness.

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

Completeness3/5

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

Given the absence of an output schema, the description should ideally mention what the tool returns (e.g., created enrollment ID). It also omits preconditions (e.g., teacher and planned course must exist). Annotations cover idempotency, but completeness still suffers from missing return info and constraints.

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?

The schema descriptions cover all three parameters (100% coverage), so the baseline is 3. The tool description does not add any extra meaning beyond the schema; it only mentions 'teacher' and 'planned course' which are already implied by parameter names. No clarification for the potentially misleading schema description for 'planned_course_id' is provided.

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

Purpose4/5

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

The description clearly states the action: 'Enroll a teacher to the given planned course.' It uses a specific verb and resource, and directly matches the tool's name. However, it does not differentiate from the sibling tool 'create_teacher_enrollment', which may serve a similar but possibly different purpose.

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 usage guidance is provided. The description does not indicate when to use this tool versus alternatives like 'create_teacher_enrollment', nor does it mention prerequisites or that 'teacher_role_id' is optional. Context signals show two required parameters, but the description offers no decision support.

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