Skip to main content
Glama

get_catalog_variants

Read-onlyIdempotent

Retrieve catalog variants with filters for pagination, publication status, product, and variantable type.

Instructions

Get all catalog variants

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cursorNoCursor for fetching the next page of results
per_pageNoNumber of results per page (default: 25)
published_publicNoOnly show published variants and planned_courses that are either planned or in progress
product_idNoFilter results on product_id
variantable_idNoFilter results on variantable_id
variantable_typeNoFilter results on variantable_type

Implementation Reference

  • The handler function for the 'get_catalog_variants' tool. Calls apiList to fetch catalog variants with optional filters (cursor, per_page, published_public, product_id, variantable_id, variantable_type), logs the response, formats the results using formatList, and appends a next-page cursor if present.
    async ({ cursor, per_page, published_public, product_id, variantable_id, variantable_type }) => {
      try {
        const result = await apiList<EduframeRecord>("/catalog/variants", {
          cursor,
          per_page,
          published_public,
          product_id,
          variantable_id,
          variantable_type,
        });
        void logResponse(
          "get_catalog_variants",
          { cursor, per_page, published_public, product_id, variantable_id, variantable_type },
          result,
        );
        const toolResult = formatList(result.records, "catalog variants");
        if (result.nextCursor) {
          toolResult.content.push({ type: "text", text: `\nNext page cursor: ${result.nextCursor}` });
        }
        return toolResult;
      } catch (error) {
        return formatError(error);
      }
    },
  • The input schema definition for the 'get_catalog_variants' tool, including optional filters for cursor, per_page, published_public, product_id, variantable_id, and variantable_type.
    {
      description: "Get all catalog variants",
      annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
      inputSchema: {
        cursor: z.string().optional().describe("Cursor for fetching the next page of results"),
        per_page: z.number().int().positive().optional().describe("Number of results per page (default: 25)"),
        published_public: z
          .enum(["published_public"])
          .optional()
          .describe("Only show published variants and planned_courses that are either planned or in progress"),
        product_id: z.number().int().optional().describe("Filter results on product_id"),
        variantable_id: z.number().int().optional().describe("Filter results on variantable_id"),
        variantable_type: z
          .enum(["planned_course", "program_edition"])
          .optional()
          .describe("Filter results on variantable_type"),
      },
  • Registration of the 'get_catalog_variants' tool using server.registerTool within the registerCatalogVariantTools function.
    server.registerTool(
      "get_catalog_variants",
      {
        description: "Get all catalog variants",
        annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
        inputSchema: {
          cursor: z.string().optional().describe("Cursor for fetching the next page of results"),
          per_page: z.number().int().positive().optional().describe("Number of results per page (default: 25)"),
          published_public: z
            .enum(["published_public"])
            .optional()
            .describe("Only show published variants and planned_courses that are either planned or in progress"),
          product_id: z.number().int().optional().describe("Filter results on product_id"),
          variantable_id: z.number().int().optional().describe("Filter results on variantable_id"),
          variantable_type: z
            .enum(["planned_course", "program_edition"])
            .optional()
            .describe("Filter results on variantable_type"),
        },
      },
      async ({ cursor, per_page, published_public, product_id, variantable_id, variantable_type }) => {
        try {
          const result = await apiList<EduframeRecord>("/catalog/variants", {
            cursor,
            per_page,
            published_public,
            product_id,
            variantable_id,
            variantable_type,
          });
          void logResponse(
            "get_catalog_variants",
            { cursor, per_page, published_public, product_id, variantable_id, variantable_type },
            result,
          );
          const toolResult = formatList(result.records, "catalog variants");
          if (result.nextCursor) {
            toolResult.content.push({ type: "text", text: `\nNext page cursor: ${result.nextCursor}` });
          }
          return toolResult;
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • Calls apiList helper to fetch catalog variants from the /catalog/variants endpoint with the provided filter parameters.
    const result = await apiList<EduframeRecord>("/catalog/variants", {
      cursor,
      per_page,
      published_public,
      product_id,
      variantable_id,
      variantable_type,
    });
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 cover safety. The description adds no extra behavioral context such as pagination behavior, rate limits, or error handling. The description does not contradict annotations (annotation_contradiction=false).

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 a single sentence, which is concise but lacks additional useful information. It is front-loaded with the action, but could be improved by mentioning pagination or filtering options briefly.

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 has 6 optional parameters, pagination support, and no output schema, the description fails to mention return structure or pagination behavior. While not critically lacking, it misses opportunities to fully inform the agent.

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 description coverage is 100%, so the baseline is 3. The description does not add any additional explanation for parameters beyond what the schema already provides. The parameters are adequately described in 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 'Get all catalog variants' clearly indicates a read operation on catalog variants. The plural form distinguishes it from the singular sibling 'get_catalog_variant'. However, 'all' is slightly misleading since the tool supports filtering, but the purpose is still clear.

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 does not provide any guidance on when to use this tool versus alternatives. Sibling tools like 'get_catalog_variant' (singular) exist, but no comparison is made. No context on prerequisites or appropriate use 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