Skip to main content
Glama

create_teacher_role

Creates a new teacher role by specifying its name, used to classify and assign permissions to educators.

Instructions

Create a teacher role.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name of the teacher role.

Implementation Reference

  • The handler function for the 'create_teacher_role' tool. It takes a 'name' input, POSTs to '/teacher_roles' via apiPost, logs the response, and formats the result.
    server.registerTool(
      "create_teacher_role",
      {
        description: "Create a teacher role.",
        annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
        inputSchema: { name: z.string().describe("The name of the teacher role.") },
      },
      async (body) => {
        try {
          const record = await apiPost<EduframeRecord>("/teacher_roles", body);
          void logResponse("create_teacher_role", body, record);
          return formatCreate(record, "teacher role");
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • Input schema for 'create_teacher_role' defined inline with Zod: requires a 'name' string field.
    server.registerTool(
      "create_teacher_role",
      {
        description: "Create a teacher role.",
        annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
        inputSchema: { name: z.string().describe("The name of the teacher role.") },
      },
      async (body) => {
        try {
          const record = await apiPost<EduframeRecord>("/teacher_roles", body);
          void logResponse("create_teacher_role", body, record);
          return formatCreate(record, "teacher role");
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • The tool is registered via server.registerTool('create_teacher_role', ...) inside the registerTeacherRoleTools function.
    export function registerTeacherRoleTools(server: McpServer): void {
      server.registerTool(
        "get_teacher_roles",
        {
          description: "Get all teacher roles",
          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)"),
          },
        },
        async ({ cursor, per_page }) => {
          try {
            const result = await apiList<EduframeRecord>("/teacher_roles", { cursor, per_page });
            void logResponse("get_teacher_roles", { cursor, per_page }, result);
            const toolResult = formatList(result.records, "teacher roles");
            if (result.nextCursor) {
              toolResult.content.push({ type: "text", text: `\nNext page cursor: ${result.nextCursor}` });
            }
            return toolResult;
          } catch (error) {
            return formatError(error);
          }
        },
      );
    
      server.registerTool(
        "get_teacher_role",
        {
          description: "Get a teacher role",
          annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
          inputSchema: { id: z.number().int().positive().describe("ID of the teacher role to retrieve") },
        },
        async ({ id }) => {
          try {
            const record = await apiGet<EduframeRecord>(`/teacher_roles/${id}`);
            void logResponse("get_teacher_role", { id }, record);
            return formatShow(record, "teacher role");
          } catch (error) {
            return formatError(error);
          }
        },
      );
    
      server.registerTool(
        "create_teacher_role",
        {
          description: "Create a teacher role.",
          annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
          inputSchema: { name: z.string().describe("The name of the teacher role.") },
        },
        async (body) => {
          try {
            const record = await apiPost<EduframeRecord>("/teacher_roles", body);
            void logResponse("create_teacher_role", body, record);
            return formatCreate(record, "teacher role");
          } catch (error) {
            return formatError(error);
          }
        },
      );
    
      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);
          }
        },
      );
    
      server.registerTool(
        "delete_teacher_role",
        {
          description: "Delete a teacher role.",
          annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true },
          inputSchema: { id: z.number().int().positive().describe("ID of the teacher role to delete") },
        },
        async ({ id }) => {
          try {
            const record = await apiDelete<EduframeRecord>(`/teacher_roles/${id}`);
            void logResponse("delete_teacher_role", { id }, record);
            return formatDelete(record, "teacher role");
          } catch (error) {
            return formatError(error);
          }
        },
      );
    }
Behavior2/5

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

Annotations show readOnlyHint=false, destructiveHint=false, idempotentHint=false, but the description adds no behavioral details beyond 'create'. It does not disclose what happens after creation (e.g., return value, side effects) or any permissions needed. No contradiction with annotations.

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 sentence, making it very concise. While it could be expanded slightly, it is appropriately brief for a simple tool with one parameter.

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?

Given the tool's simplicity (one param, no output schema), the description lacks sufficient context. It does not explain what a teacher role is used for, whether the creation returns anything, or any related actions. This leads to incomplete understanding for an AI 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 coverage is 100% and the input schema already describes the 'name' parameter as 'The name of the teacher role.' The description adds no additional meaning beyond this, so baseline score of 3 is appropriate.

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 'Create a teacher role' clearly states the action (create) and resource (teacher role). It is specific and distinguishes itself from sibling tools like create_teacher, update_teacher_role, etc., though it lacks any additional context.

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 or any prerequisites. The description does not mention when creating a teacher role is appropriate or how it relates to other actions.

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