Skip to main content
Glama

create_course_variant

Create a new course variant by specifying its name to extend course offerings.

Instructions

Create a course variant

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name of the course variant.

Implementation Reference

  • The async handler function for the create_course_variant tool. It receives body params, POSTs to /course_variants via apiPost, logs the response, and returns formatCreate result on success or formatError on failure.
    async (body) => {
      try {
        const record = await apiPost<EduframeRecord>("/course_variants", body);
        void logResponse("create_course_variant", body, record);
        return formatCreate(record, "course variant");
      } catch (error) {
        return formatError(error);
      }
    },
  • Tool metadata and input schema for create_course_variant. Defines description, annotations (non-readonly, non-destructive, non-idempotent), and inputSchema requiring a 'name' string field.
    {
      description: "Create a course variant",
      annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
      inputSchema: { name: z.string().describe("The name of the course variant.") },
    },
  • Registration of create_course_variant via server.registerTool within registerCourseVariantTools(). This binds the tool name, schema, and handler together.
    server.registerTool(
      "create_course_variant",
      {
        description: "Create a course variant",
        annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
        inputSchema: { name: z.string().describe("The name of the course variant.") },
      },
      async (body) => {
        try {
          const record = await apiPost<EduframeRecord>("/course_variants", body);
          void logResponse("create_course_variant", body, record);
          return formatCreate(record, "course variant");
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • The apiPost helper function that the handler calls internally. Performs a POST request to the specified API path with a JSON body.
    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 by the handler to format the created resource into a human-readable CallToolResult.
    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?

Annotations indicate readOnlyHint=false, destructiveHint=false, idempotentHint=false, which are minimal. The description adds no behavioral details such as side effects, permissions, or return behavior. Score 2 for lacking transparency beyond annotations.

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

Conciseness3/5

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

The description is one sentence, concise but not informative. It essentially repeats the tool name. Appropriate size for a simple tool, but adds no value. Score 3 for minimal structure.

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 create tool with no output schema and one parameter, the description should at least hint at the result or domain. It is incomplete; the agent may not know what a course variant is or what happens after creation. Score 2 for insufficient context.

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 for the single parameter 'name' is 100% with a description. The tool description does not add extra meaning beyond what the schema provides. Baseline 3 is appropriate since the schema already documents the parameter adequately.

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 course variant' clearly states the action and resource. It is specific but lacks differentiation from sibling tools like create_course or create_program_edition. Score 4 for clear purpose but no sibling distinction.

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 (e.g., create_course or get_course_variant). The description does not mention prerequisites or exclusions. Score 2 for missing usage 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