Skip to main content
Glama

get_catalog_variant

Read-onlyIdempotent

Retrieve a catalog variant record by its ID. Access variant details for use in lead management and educational resource workflows.

Instructions

Get a catalog variant record

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the catalog variant to retrieve

Implementation Reference

  • The handler function for the 'get_catalog_variant' tool. It takes { id }, calls apiGet to fetch the catalog variant from '/catalog/variants/{id}', logs the response, and formats the result using formatShow.
    async ({ id }) => {
      try {
        const record = await apiGet<EduframeRecord>(`/catalog/variants/${id}`);
        void logResponse("get_catalog_variant", { id }, record);
        return formatShow(record, "catalog variant");
      } catch (error) {
        return formatError(error);
      }
    },
  • Input schema for the 'get_catalog_variant' tool: requires a single 'id' parameter (positive integer) describing the catalog variant to retrieve.
    description: "Get a catalog variant record",
    annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
    inputSchema: { id: z.number().int().positive().describe("ID of the catalog variant to retrieve") },
  • Registration of the 'get_catalog_variant' tool via server.registerTool() within registerCatalogVariantTools.
    server.registerTool(
      "get_catalog_variant",
      {
        description: "Get a catalog variant record",
        annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
        inputSchema: { id: z.number().int().positive().describe("ID of the catalog variant to retrieve") },
      },
      async ({ id }) => {
        try {
          const record = await apiGet<EduframeRecord>(`/catalog/variants/${id}`);
          void logResponse("get_catalog_variant", { id }, record);
          return formatShow(record, "catalog variant");
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • The apiGet helper function used by the handler to perform the GET request to the Eduframe API.
    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);
    }
  • The formatShow helper used by the handler to format the retrieved catalog variant record as a 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 clearly indicate a safe, read-only operation. The description simply states 'Get', which aligns with annotations but adds no extra behavioral context beyond what annotations provide.

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 sentence of 5 words, front-loaded with the verb and resource. It is efficient but lacks any elaboration that could provide context. Still, it earns a 4 for no unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple retrieval tool with one parameter and clear annotations, the description is sufficient. No output schema exists, but the tool's low complexity means missing return value explanation is acceptable. The description is complete enough for an AI agent to understand its basic function.

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% coverage with a single parameter 'id' described as 'ID of the catalog variant to retrieve'. The description does not mention any parameter details, so it adds no value beyond the schema. Baseline score of 3 is appropriate given full schema coverage.

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 the resource 'catalog variant record'. It distinguishes from sibling tools like 'get_catalog_variants' (plural list) and 'update_catalog_variant'. However, it lacks specifics on what a catalog variant represents.

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_catalog_variants' for listing or 'update_catalog_variant' for modification. It neither specifies the context (e.g., fetching by ID) nor excludes cases.

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