Skip to main content
Glama

update_teacher_role

Idempotent

Update a teacher role by specifying its ID and new name.

Instructions

Update a teacher role.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the teacher role to update
nameYesThe name of the teacher role.

Implementation Reference

  • Handler: Registers the 'update_teacher_role' MCP tool. Uses apiPatch to send a PATCH request to /teacher_roles/:id with the id and name fields, then formats the response.
    server.registerTool(
      "update_teacher_role",
      {
        description: "Update a teacher role.",
        annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
        inputSchema: {
          id: z.number().int().positive().describe("ID of the teacher role to update"),
          name: z.string().describe("The name of the teacher role."),
        },
      },
      async ({ id, ...body }) => {
        try {
          const record = await apiPatch<EduframeRecord>(`/teacher_roles/${id}`, body);
          void logResponse("update_teacher_role", { id, ...body }, record);
          return formatUpdate(record, "teacher role");
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • Input schema: requires 'id' (positive int) and 'name' (string).
    inputSchema: {
      id: z.number().int().positive().describe("ID of the teacher role to update"),
      name: z.string().describe("The name of the teacher role."),
    },
  • Tool registration: called from registerTeacherRoleTools() in teacher_roles.ts, which is invoked via registerAllTools() in tools/index.ts.
    server.registerTool(
      "update_teacher_role",
      {
        description: "Update a teacher role.",
        annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
        inputSchema: {
          id: z.number().int().positive().describe("ID of the teacher role to update"),
          name: z.string().describe("The name of the teacher role."),
        },
      },
      async ({ id, ...body }) => {
        try {
          const record = await apiPatch<EduframeRecord>(`/teacher_roles/${id}`, body);
          void logResponse("update_teacher_role", { id, ...body }, record);
          return formatUpdate(record, "teacher role");
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • Helper: apiPatch sends a PATCH request used by the update_teacher_role handler.
    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);
    }
  • Helper: formatUpdate creates a success message for the updated teacher role.
    export function formatUpdate(record: EduframeRecord, resourceName: string): CallToolResult {
      return {
        content: [
          {
            type: "text",
            text: `Successfully updated ${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 indicate the tool is not read-only (false), not destructive (false), and idempotent (true). The description does not add any additional behavioral context beyond what annotations provide. With annotations covering safety profile, a baseline score of 3 is appropriate.

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

Conciseness5/5

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

The description is a single, complete sentence with zero waste. It is appropriately front-loaded and conveys the essential purpose without any extraneous text.

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?

For a simple update tool with two parameters and no output schema, the minimal description is adequate but not exceptional. It omits details like return value, error behavior (e.g., if ID doesn't exist), and side effects, which could be helpful for an agent. Overall, it meets the minimum viable threshold.

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 already covers 100% of parameters with clear descriptions ('ID of the teacher role to update', 'The name of the teacher role.'). The description adds no extra semantic detail beyond the schema, so a baseline score of 3 is warranted.

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 ('Update') and the resource ('a teacher role'), directly distinguishing it from sibling tools like create_teacher_role and delete_teacher_role. The verb-resource pair is specific and unambiguous.

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 vs. alternatives (e.g., create_teacher_role for new roles, get_teacher_role for reading). There is no mention of prerequisites such as the role needing to exist or the user needing certain permissions.

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