Skip to main content
Glama

cancel_enrollment

Idempotent

Cancel an enrollment by providing its ID. Use this tool to remove or invalidate a student's enrollment record.

Instructions

Cancel an enrollment

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the enrollment

Implementation Reference

  • The handler function for 'cancel_enrollment' tool, registered via server.registerTool. It takes an enrollment ID, calls apiPut to POST to /enrollments/{id}/cancel, logs the response, and returns the formatted enrollment record.
    server.registerTool(
      "cancel_enrollment",
      {
        description: "Cancel an enrollment",
        annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
        inputSchema: { id: z.number().int().positive().describe("ID of the enrollment") },
      },
      async ({ id }) => {
        try {
          const record = await apiPut<EduframeRecord>(`/enrollments/${id}/cancel`, {});
          void logResponse("cancel_enrollment", { id }, record);
          return formatShow(record, "enrollment");
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • Input schema for 'cancel_enrollment' — requires an 'id' field (positive integer) describing the enrollment ID.
    {
      description: "Cancel an enrollment",
      annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
      inputSchema: { id: z.number().int().positive().describe("ID of the enrollment") },
  • Tool registered via server.registerTool with name 'cancel_enrollment' inside registerEnrollmentTools(). The registration function is exported from enrollments.ts, imported in src/tools/index.ts, and called from registerAllTools().
      server.registerTool(
        "cancel_enrollment",
        {
          description: "Cancel an enrollment",
          annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
          inputSchema: { id: z.number().int().positive().describe("ID of the enrollment") },
        },
        async ({ id }) => {
          try {
            const record = await apiPut<EduframeRecord>(`/enrollments/${id}/cancel`, {});
            void logResponse("cancel_enrollment", { id }, record);
            return formatShow(record, "enrollment");
          } catch (error) {
            return formatError(error);
          }
        },
      );
    }
  • The apiPut helper used by the handler — performs an HTTP PUT request to the given API path with a JSON body.
    export async function apiPut<T>(path: string, body: unknown): Promise<T> {
      const { token } = getConfig();
      const url = buildUrl(path);
    
      const response = await fetch(url.toString(), {
        method: "PUT",
        headers: buildHeaders(token),
        body: JSON.stringify(body),
      });
    
      return handleResponse<T>(response);
    }
Behavior3/5

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

Annotations indicate idempotentHint=true and destructiveHint=false, but the description does not clarify what 'cancel' entails (e.g., status change vs. deletion). There is 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.

Conciseness3/5

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

Extremely brief (3 words), which is concise but risks being too vague. It lacks structure and front-loading of key details for an AI agent.

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?

No output schema, but the description does not explain return values or the effect of cancellation. Context about the type of enrollment (course? program?) is missing, and there is no differentiation from sibling cancel_program_enrollment.

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 covers the single required parameter 'id' with a clear description. The tool description adds no additional parameter information beyond 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 action ('Cancel') and the resource ('an enrollment'), but does not differentiate from sibling tools like cancel_program_enrollment or update_enrollment. It is specific enough for a general understanding.

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 cancel_program_enrollment or update_enrollment. The description does not mention context, prerequisites, or exclusions.

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