Skip to main content
Glama

get_teacher_role

Read-onlyIdempotent

Retrieve a teacher role by ID to view its details. This tool fetches role information from Eduframe.

Instructions

Get a teacher role

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the teacher role to retrieve

Implementation Reference

  • Handler function for the 'get_teacher_role' tool. Calls apiGet to fetch a single teacher role by ID, logs the response, and formats the result.
    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);
      }
    },
  • Input schema for 'get_teacher_role' - accepts 'id' (positive integer) as the required parameter.
    {
      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") },
    },
  • Registration of 'get_teacher_role' tool via server.registerTool within the registerTeacherRoleTools function.
    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);
        }
      },
    );
  • registerTeacherRoleTools is included in the tools array and called by registerAllTools.
      registerTeacherRoleTools,
      registerTeacherTools,
      registerTheseTools,
      registerUserTools,
      registerWebhookNotificationTools,
      registerWebhookTools,
    ];
    
    export function registerAllTools(server: McpServer): void {
      for (const register of tools) {
        register(server);
      }
    }
  • formatShow helper that formats the API response into a CallToolResult with human-readable JSON output.
    export function formatShow(record: EduframeRecord, resourceName: string): CallToolResult {
      return {
        content: [
          {
            type: "text",
            text: `${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 declare readOnlyHint=true, destructiveHint=false, idempotentHint=true. Description adds no additional behavioral context (e.g., authentication requirements, response structure). With annotations present, the description's lack of extra detail is acceptable but not additive.

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?

Single sentence, directly states purpose, no redundancy. Highly concise and front-loaded.

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?

Given the simplicity (1 param, no output schema), the description is minimally adequate. However, it lacks any mention of the return value or structure, which would be helpful without an output schema.

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% with a single parameter ('id') that is self-explanatory. Description does not enhance understanding beyond the schema, but no additional context is needed.

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?

Description clearly states the action ('Get') and resource ('teacher role'). It is specific and distinguishes from sibling tools like 'create_teacher_role' and 'get_teacher_roles' (plural), though it does not explicitly highlight the singular/plural difference.

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 such as 'get_teacher_roles' (for listing) or other retrieval tools. Lacks use case context.

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