Skip to main content
Glama

update_program_element

Idempotent

Update a program element by its ID, with optional assignment to a course edition or planned course.

Instructions

Update an element

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the program element to update
edition_idNoThe identifier of the associated course.
planned_course_idNoThe identifier of the associated course.

Implementation Reference

  • The async handler function that executes the update_program_element tool logic. It extracts the `id` from input, PATCHes the remaining body to `/program/elements/${id}`, logs the response, and returns formatted output.
    async ({ id, ...body }) => {
      try {
        const record = await apiPatch<EduframeRecord>(`/program/elements/${id}`, body);
        void logResponse("update_program_element", { id, ...body }, record);
        return formatUpdate(record, "program element");
      } catch (error) {
        return formatError(error);
      }
    },
  • Input schema defined with Zod, requiring an `id` (positive int), and optional `edition_id` and `planned_course_id` (both ints).
    inputSchema: {
      id: z.number().int().positive().describe("ID of the program element to update"),
      edition_id: z.number().int().optional().describe("The identifier of the associated course."),
      planned_course_id: z.number().int().optional().describe("The identifier of the associated course."),
    },
  • The full tool registration via server.registerTool, binding the name 'update_program_element' with its description, annotations, input schema, and handler function.
    server.registerTool(
      "update_program_element",
      {
        description: "Update an element",
        annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
        inputSchema: {
          id: z.number().int().positive().describe("ID of the program element to update"),
          edition_id: z.number().int().optional().describe("The identifier of the associated course."),
          planned_course_id: z.number().int().optional().describe("The identifier of the associated course."),
        },
      },
      async ({ id, ...body }) => {
        try {
          const record = await apiPatch<EduframeRecord>(`/program/elements/${id}`, body);
          void logResponse("update_program_element", { id, ...body }, record);
          return formatUpdate(record, "program element");
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • Uses the apiPatch helper to send a PATCH request to the API endpoint.
    import { apiDelete, apiGet, apiList, apiPatch, apiPost } from "../api";
  • Uses the formatUpdate helper to format the response.
    formatUpdate,
Behavior2/5

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

Annotations indicate idempotentHint=true and readOnlyHint=false, but the description adds no extra behavioral context. It does not mention what side effects occur, what data is affected, or any constraints beyond the schema.

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

Conciseness2/5

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

Extremely brief but under-specified; one sentence with no structure. Conciseness without informativeness is inadequate.

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?

For an update tool with 3 parameters and no output schema, the description should specify which fields can be updated and the expected behavior. It fails to provide that, leaving the agent underinformed.

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

Parameters2/5

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

Schema descriptions are poor: edition_id and planned_course_id both say 'The identifier of the associated course' which is likely incorrect and not differentiating. The tool description adds no clarification for these parameters.

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

Purpose2/5

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

The description 'Update an element' is vague; it does not specify that it updates a program element. The tool name includes 'program_element', but the description uses 'element', which lacks specificity and does not distinguish from sibling update tools.

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 on when to use this tool versus alternatives like update_program or update_program_edition. There is no mention of prerequisites or context for updating program elements.

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