Skip to main content
Glama

get_course_variant

Read-onlyIdempotent

Retrieve a course variant record by providing its ID. Access detailed variant data from the Eduframe system.

Instructions

Get a course variant record

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the course variant to retrieve

Implementation Reference

  • Handler function for the 'get_course_variant' tool. Calls GET /course_variants/:id via apiGet, logs the response, and formats the result using formatShow.
    async ({ id }) => {
      try {
        const record = await apiGet<EduframeRecord>(`/course_variants/${id}`);
        void logResponse("get_course_variant", { id }, record);
        return formatShow(record, "course variant");
      } catch (error) {
        return formatError(error);
      }
    },
  • Input schema for get_course_variant: requires a positive integer id parameter.
    inputSchema: { id: z.number().int().positive().describe("ID of the course variant to retrieve") },
  • Registration of the 'get_course_variant' tool via McpServer.registerTool, with schema and handler.
    server.registerTool(
      "get_course_variant",
      {
        description: "Get a course variant record",
        annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
        inputSchema: { id: z.number().int().positive().describe("ID of the course variant to retrieve") },
      },
      async ({ id }) => {
        try {
          const record = await apiGet<EduframeRecord>(`/course_variants/${id}`);
          void logResponse("get_course_variant", { id }, record);
          return formatShow(record, "course variant");
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • Helper function apiGet used by the handler to perform a GET request to /course_variants/:id.
    export async function apiGet<T>(path: string, query?: Record<string, QueryValue>): Promise<T> {
      const { token } = getConfig();
      const url = buildUrl(path, query);
    
      const response = await fetch(url.toString(), {
        method: "GET",
        headers: buildHeaders(token),
      });
    
      return handleResponse<T>(response);
    }
  • Helper function formatShow used to format the course variant record as a human-readable text response.
    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, and idempotentHint=true, which sufficiently indicate the tool is a safe read. The description adds nothing beyond 'Get a record', so it meets the baseline but does not provide additional behavioral context such as response details.

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 concise sentence that is front-loaded with the core action. It is appropriately short for a simple retrieval tool, though it could include a brief context note.

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 tool's simplicity (one parameter, good annotations), the description is minimally adequate. However, it lacks any mention of the return value structure, which would be helpful since there is no output schema. Some context about the response (e.g., 'returns full course variant details') would improve completeness.

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 documents the required 'id' parameter with a description. Since schema description coverage is 100%, the description adds no extra meaning. The tool name 'get_course_variant' implies the 'id' refers to a course variant ID, which is clear from the schema.

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 clearly states the verb 'Get' and resource 'course variant record', indicating a single retrieval operation. However, it does not differentiate from the sibling tool 'get_course_variants' which retrieves multiple variants, so the uniqueness is implied but not explicit.

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?

The description provides no guidance on when to use this tool versus alternatives like 'get_course_variants' for listing or other get tools. It lacks any context about prerequisites or selection criteria.

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