Skip to main content
Glama

update_material_group

Idempotent

Update an existing material group by specifying its ID and optionally providing a new name.

Instructions

Update a material group.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the material group to update
nameNoName of the material group where the course is held.

Implementation Reference

  • Handler for the 'update_material_group' tool. Receives an object with `id` (required) and optional `name`, destructures `id` from the rest of the body, calls `apiPatch` on `/material_groups/${id}`, logs the response, and returns a formatted update result.
    server.registerTool(
      "update_material_group",
      {
        description: "Update a material group.",
        annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
        inputSchema: {
          id: z.number().int().positive().describe("ID of the material group to update"),
          name: z.string().optional().describe("Name of the material group where the course is held."),
        },
      },
      async ({ id, ...body }) => {
        try {
          const record = await apiPatch<EduframeRecord>(`/material_groups/${id}`, body);
          void logResponse("update_material_group", { id, ...body }, record);
          return formatUpdate(record, "material group");
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • Input schema for the 'update_material_group' tool. Defines `id` (required positive integer) and `name` (optional string) using Zod validation.
    inputSchema: {
      id: z.number().int().positive().describe("ID of the material group to update"),
      name: z.string().optional().describe("Name of the material group where the course is held."),
    },
  • Registration of 'update_material_group' via `server.registerTool()` inside `registerMaterialGroupTools()`, with description and annotations (non-destructive, idempotent).
    server.registerTool(
      "update_material_group",
      {
        description: "Update a material group.",
        annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
        inputSchema: {
          id: z.number().int().positive().describe("ID of the material group to update"),
          name: z.string().optional().describe("Name of the material group where the course is held."),
        },
      },
      async ({ id, ...body }) => {
        try {
          const record = await apiPatch<EduframeRecord>(`/material_groups/${id}`, body);
          void logResponse("update_material_group", { id, ...body }, record);
          return formatUpdate(record, "material group");
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • The `apiPatch` helper function used by the handler to send a PATCH request to the Eduframe API.
    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);
    }
  • The `formatUpdate` helper function that formats the API response into a human-readable tool result.
    export function formatUpdate(record: EduframeRecord, resourceName: string): CallToolResult {
      return {
        content: [
          {
            type: "text",
            text: `Successfully updated ${resourceName}:\n\n${formatJSON(record)}${RESPONSE_LOG_HINT}`,
          },
        ],
      };
    }
Behavior2/5

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

The description does not add any behavioral context beyond the annotations (readOnlyHint=false, destructiveHint=false, idempotentHint=true). It does not mention that the tool modifies an existing resource or any side effects, leaving the agent without extra insight.

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 very concise with a single sentence, but it lacks structure or front-loading of key information. It is not overly verbose, but could be more informative without sacrificing brevity.

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 a simple update tool with two parameters and no output schema, the description is minimal. It does not explain the return value, prerequisites (e.g., the group must exist), or any constraints, leaving the agent with incomplete context.

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 input schema covers 100% of parameters with descriptions, so the description adds no additional meaning. Baseline score of 3 is appropriate as the schema does the heavy lifting.

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 material group' clearly specifies the verb (update) and resource (material group), distinguishing it from sibling tools such as create_material_group and delete_material_group. However, it could be more specific about which fields can be updated.

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 alternatives like create_material_group or get_material_group, nor any prerequisites or context for when an update is appropriate.

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