Skip to main content
Glama

update_course

Idempotent

Update an existing course by providing its ID and optional fields like name, code, duration, or level to modify course details.

Instructions

Update a course.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the course to update
category_idNoIdentifier of the category of the course.
nameNoThe name of the course.
codeNoThe code of the course.
durationNoThe duration of the course.
levelNoA string indicating the level of the course.
resultNoThe result of the course
costNoThe price to be paid for this course.
cost_schemeNoHow should the course be paid by default.
is_publishedNoBoolean representing the publishable status of the course.
conditionsNoThe conditions of the course.
customNo
custom_associationsNo
course_tab_contents_attributesNo

Implementation Reference

  • The 'update_course' tool handler - registers the tool with schema and handler function that calls apiPatch on /courses/{id}, then formats the response as a successful update.
    server.registerTool(
      "update_course",
      {
        description: "Update a course.",
        annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
        inputSchema: {
          id: z.number().int().positive().describe("ID of the course to update"),
          category_id: z.number().int().optional().describe("Identifier of the category of the course."),
          name: z.string().optional().describe("The name of the course."),
          code: z.string().optional().describe("The code of the course."),
          duration: z.string().optional().describe("The duration of the course."),
          level: z.string().optional().describe("A string indicating the level of the course."),
          result: z.string().optional().describe("The result of the course"),
          cost: z.string().optional().describe("The price to be paid for this course."),
          cost_scheme: courseCostSchemeEnum.optional().describe("How should the course be paid by default."),
          is_published: z.boolean().optional().describe("Boolean representing the publishable status of the course."),
          conditions: z.string().optional().describe("The conditions of the course."),
          custom: z.record(z.unknown()).optional(),
          custom_associations: z.record(z.unknown()).optional(),
          course_tab_contents_attributes: z
            .array(
              z.object({
                content: z.string().optional().describe("The HTML content of the course tab."),
                course_tab_id: z.number().int().optional().describe("Unique identifier of the course tab."),
              }),
            )
            .optional(),
        },
      },
      async ({ id, ...body }) => {
        try {
          const record = await apiPatch<EduframeRecord>(`/courses/${id}`, body);
          void logResponse("update_course", { id, ...body }, record);
          return formatUpdate(record, "course");
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • Input schema for 'update_course' - defines the id (required) and all optional fields for updating a course.
    inputSchema: {
      id: z.number().int().positive().describe("ID of the course to update"),
      category_id: z.number().int().optional().describe("Identifier of the category of the course."),
      name: z.string().optional().describe("The name of the course."),
      code: z.string().optional().describe("The code of the course."),
      duration: z.string().optional().describe("The duration of the course."),
      level: z.string().optional().describe("A string indicating the level of the course."),
      result: z.string().optional().describe("The result of the course"),
      cost: z.string().optional().describe("The price to be paid for this course."),
      cost_scheme: courseCostSchemeEnum.optional().describe("How should the course be paid by default."),
      is_published: z.boolean().optional().describe("Boolean representing the publishable status of the course."),
      conditions: z.string().optional().describe("The conditions of the course."),
      custom: z.record(z.unknown()).optional(),
      custom_associations: z.record(z.unknown()).optional(),
      course_tab_contents_attributes: z
        .array(
          z.object({
            content: z.string().optional().describe("The HTML content of the course tab."),
            course_tab_id: z.number().int().optional().describe("Unique identifier of the course tab."),
          }),
        )
        .optional(),
    },
  • Registration of the 'update_course' tool on the MCP server via server.registerTool().
    server.registerTool(
      "update_course",
      {
        description: "Update a course.",
        annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
        inputSchema: {
          id: z.number().int().positive().describe("ID of the course to update"),
          category_id: z.number().int().optional().describe("Identifier of the category of the course."),
          name: z.string().optional().describe("The name of the course."),
          code: z.string().optional().describe("The code of the course."),
          duration: z.string().optional().describe("The duration of the course."),
          level: z.string().optional().describe("A string indicating the level of the course."),
          result: z.string().optional().describe("The result of the course"),
          cost: z.string().optional().describe("The price to be paid for this course."),
          cost_scheme: courseCostSchemeEnum.optional().describe("How should the course be paid by default."),
          is_published: z.boolean().optional().describe("Boolean representing the publishable status of the course."),
          conditions: z.string().optional().describe("The conditions of the course."),
          custom: z.record(z.unknown()).optional(),
          custom_associations: z.record(z.unknown()).optional(),
          course_tab_contents_attributes: z
            .array(
              z.object({
                content: z.string().optional().describe("The HTML content of the course tab."),
                course_tab_id: z.number().int().optional().describe("Unique identifier of the course tab."),
              }),
            )
            .optional(),
        },
      },
      async ({ id, ...body }) => {
        try {
          const record = await apiPatch<EduframeRecord>(`/courses/${id}`, body);
          void logResponse("update_course", { id, ...body }, record);
          return formatUpdate(record, "course");
        } catch (error) {
          return formatError(error);
        }
      },
  • The registerCourseTools function registers all course tools including 'update_course'. This is called from registerAllTools in src/tools/index.ts.
    export function registerCourseTools(server: McpServer): void {
      server.registerTool(
        "get_courses",
        {
          description: "Get all course 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)"),
            published: z.enum(["published"]).optional().describe("Show only published courses"),
          },
        },
        async ({ cursor, per_page, published }) => {
          try {
            const result = await apiList<EduframeRecord>("/courses", { cursor, per_page, published });
            void logResponse("get_courses", { cursor, per_page, published }, result);
            const toolResult = formatList(result.records, "courses");
            if (result.nextCursor) {
              toolResult.content.push({ type: "text", text: `\nNext page cursor: ${result.nextCursor}` });
            }
            return toolResult;
          } catch (error) {
            return formatError(error);
          }
        },
      );
    
      server.registerTool(
        "get_course",
        {
          description: "Get a course record",
          annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
          inputSchema: { id: z.number().int().positive().describe("ID of the course to retrieve") },
        },
        async ({ id }) => {
          try {
            const record = await apiGet<EduframeRecord>(`/courses/${id}`);
            void logResponse("get_course", { id }, record);
            return formatShow(record, "course");
          } catch (error) {
            return formatError(error);
          }
        },
      );
    
      server.registerTool(
        "create_course",
        {
          description: "Create a course.",
          annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
          inputSchema: {
            category_id: z.number().int().describe("Identifier of the category of the course."),
            name: z.string().describe("The name of the course."),
            code: z.string().describe("The code of the course."),
            cost_scheme: courseCostSchemeEnum.optional().describe("How should the course be paid by default."),
            cost: z
              .string()
              .optional()
              .describe(
                "The price to be paid for this course. Required if cost_scheme is student (default value) or order.",
              ),
            is_published: z.boolean().optional().describe("Boolean representing the publishable status of the course."),
            custom: z.record(z.unknown()).optional(),
            custom_associations: z.record(z.unknown()).optional(),
            course_tab_contents_attributes: z
              .array(
                z.object({
                  content: z.string().describe("The HTML content of the course tab."),
                  course_tab_id: z.number().int().describe("Unique identifier of the course tab."),
                }),
              )
              .optional(),
          },
        },
        async (body) => {
          try {
            const record = await apiPost<EduframeRecord>("/courses", body);
            void logResponse("create_course", body, record);
            return formatCreate(record, "course");
          } catch (error) {
            return formatError(error);
          }
        },
      );
    
      server.registerTool(
        "update_course",
        {
          description: "Update a course.",
          annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
          inputSchema: {
            id: z.number().int().positive().describe("ID of the course to update"),
            category_id: z.number().int().optional().describe("Identifier of the category of the course."),
            name: z.string().optional().describe("The name of the course."),
            code: z.string().optional().describe("The code of the course."),
            duration: z.string().optional().describe("The duration of the course."),
            level: z.string().optional().describe("A string indicating the level of the course."),
            result: z.string().optional().describe("The result of the course"),
            cost: z.string().optional().describe("The price to be paid for this course."),
            cost_scheme: courseCostSchemeEnum.optional().describe("How should the course be paid by default."),
            is_published: z.boolean().optional().describe("Boolean representing the publishable status of the course."),
            conditions: z.string().optional().describe("The conditions of the course."),
            custom: z.record(z.unknown()).optional(),
            custom_associations: z.record(z.unknown()).optional(),
            course_tab_contents_attributes: z
              .array(
                z.object({
                  content: z.string().optional().describe("The HTML content of the course tab."),
                  course_tab_id: z.number().int().optional().describe("Unique identifier of the course tab."),
                }),
              )
              .optional(),
          },
        },
        async ({ id, ...body }) => {
          try {
            const record = await apiPatch<EduframeRecord>(`/courses/${id}`, body);
            void logResponse("update_course", { id, ...body }, record);
            return formatUpdate(record, "course");
          } catch (error) {
            return formatError(error);
          }
        },
      );
  • Helper function apiPatch - performs an HTTP PATCH request, used by the 'update_course' handler to send the update to /courses/{id}.
    export async function apiPatch<T>(path: string, body: unknown): Promise<T> {
      const { token } = getConfig();
      const url = buildUrl(path);
    
      const response = await fetch(url.toString(), {
        method: "PATCH",
        headers: buildHeaders(token),
        body: JSON.stringify(body),
      });
    
      return handleResponse<T>(response);
    }
Behavior3/5

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

Annotations already declare idempotentHint=true, readOnlyHint=false, destructiveHint=false. The description adds no behavioral context beyond the tool name, but does not contradict annotations. Baseline score given annotations.

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

Conciseness3/5

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

The description is a single sentence, very concise, but essentially a tautology of the tool name. It is not verbose but also not informative beyond the repeated name.

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?

With 14 parameters including nested objects and no output schema, the description is insufficient. It does not explain partial updates, required fields, or return behavior, leaving significant gaps for the agent.

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 description coverage is high (79%), so the schema already documents most parameters. The description adds no parameter-specific information, but this is acceptable given schema richness.

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 'Update a course.' clearly states the verb 'update' and resource 'course'. It is not vague, but lacks differentiation from sibling tools like update_course_location or update_planned_course, preventing a top score.

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 specify when to use this tool versus alternatives (e.g., create_course, get_course), nor does it mention prerequisites or limitations.

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