Skip to main content
Glama

create_teacher

Assigns teacher role to a user by providing their user ID. Enables managing teacher status in Eduframe.

Instructions

Create a new teacher

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idNoThe id of the user to make a teacher

Implementation Reference

  • The actual handler/executor for the 'create_teacher' tool. Receives a body object (with optional user_id), calls apiPost to /teachers, logs the response, and formats the result.
      async (body) => {
        try {
          const record = await apiPost<EduframeRecord>("/teachers", body);
          void logResponse("create_teacher", body, record);
          return formatCreate(record, "teacher");
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • The schema/input definitions for the 'create_teacher' tool. Contains description, annotations (non-readonly, non-destructive, non-idempotent), and inputSchema with an optional user_id.
    {
      description: "Create a new teacher",
      annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
      inputSchema: { user_id: z.number().int().optional().describe("The id of the user to make a teacher") },
    },
  • Registration of the 'create_teacher' tool on the MCP server using server.registerTool() inside registerTeacherTools.
    server.registerTool(
      "create_teacher",
      {
        description: "Create a new teacher",
        annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
        inputSchema: { user_id: z.number().int().optional().describe("The id of the user to make a teacher") },
      },
      async (body) => {
        try {
          const record = await apiPost<EduframeRecord>("/teachers", body);
          void logResponse("create_teacher", body, record);
          return formatCreate(record, "teacher");
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • The apiPost helper function used by the create_teacher handler to POST to the Eduframe API at /teachers.
    export async function apiPost<T>(path: string, body: unknown): Promise<T> {
      const { token } = getConfig();
      const url = buildUrl(path);
    
      const response = await fetch(url.toString(), {
        method: "POST",
        headers: buildHeaders(token),
        body: JSON.stringify(body),
      });
    
      return handleResponse<T>(response);
    }
  • The formatCreate helper used to format the successful creation response.
    export function formatCreate(record: EduframeRecord, resourceName: string): CallToolResult {
      return {
        content: [
          {
            type: "text",
            text: `Successfully created ${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 disclose any behavioral traits beyond what is implied by the name, such as permissions, side effects, or what exactly is created. Annotations are present but provide limited context.

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?

The description is very short but underspecified, essentially repeating the tool name without adding value.

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 creation tool, the description lacks necessary context such as prerequisites, what the teacher creation entails, or relationship to users.

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 has 100% description coverage for the single parameter 'user_id', so the description does not need to add parameter semantics. Baseline 3.

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

Purpose1/5

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

The description 'Create a new teacher' is a tautology of the tool name 'create_teacher', providing no additional specificity or differentiation from siblings.

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 given on when to use this tool versus alternatives like activate_teacher or create_teacher_enrollment.

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