Skip to main content
Glama

update_catalog_variant

Idempotent

Update a catalog variant by providing its ID. Optionally set publication status and update edition description sections.

Instructions

Update a catalog variant

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the catalog variant to update
is_publishedNoBoolean showing if the variant is published or not.
edition_description_section_contents_attributesNoArray of edition description section contents to update. ![ Edition description sections ](https://img.shields.io/badge/Feature-Edition_description_sections-1d8127) ![Beta](https://img.shields.io/badge/Beta-7d15a3)

Implementation Reference

  • The handler function for 'update_catalog_variant'. It destructures id from the input, passes the remaining body to apiPatch at /catalog/variants/{id}, logs the response, and returns a formatted update result.
      async ({ id, ...body }) => {
        try {
          const record = await apiPatch<EduframeRecord>(`/catalog/variants/${id}`, body);
          void logResponse("update_catalog_variant", { id, ...body }, record);
          return formatUpdate(record, "catalog variant");
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • The input schema for 'update_catalog_variant' defining parameters: id (required, positive int), is_published (optional boolean), edition_description_section_contents_attributes (optional array of objects with content and edition_description_section_id).
    inputSchema: {
      id: z.number().int().positive().describe("ID of the catalog variant to update"),
      is_published: z.boolean().optional().describe("Boolean showing if the variant is published or not."),
      edition_description_section_contents_attributes: z
        .array(
          z.object({
            content: z.string().describe("The content of the edition description section."),
            edition_description_section_id: z
              .number()
              .int()
              .describe("Identifier of the edition description section."),
          }),
        )
        .optional()
        .describe(
          "Array of edition description section contents to update.\n\n![ Edition description sections ](https://img.shields.io/badge/Feature-Edition_description_sections-1d8127)\n![Beta](https://img.shields.io/badge/Beta-7d15a3)\n",
        ),
    },
  • The tool registration call for 'update_catalog_variant' via server.registerTool(). The function registerCatalogVariantTools (exported from this file) is imported and invoked in src/tools/index.ts (line 70) as part of registerAllTools.
    server.registerTool(
      "update_catalog_variant",
      {
        description: "Update a catalog variant",
        annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
        inputSchema: {
          id: z.number().int().positive().describe("ID of the catalog variant to update"),
          is_published: z.boolean().optional().describe("Boolean showing if the variant is published or not."),
          edition_description_section_contents_attributes: z
            .array(
              z.object({
                content: z.string().describe("The content of the edition description section."),
                edition_description_section_id: z
                  .number()
                  .int()
                  .describe("Identifier of the edition description section."),
              }),
            )
            .optional()
            .describe(
              "Array of edition description section contents to update.\n\n![ Edition description sections ](https://img.shields.io/badge/Feature-Edition_description_sections-1d8127)\n![Beta](https://img.shields.io/badge/Beta-7d15a3)\n",
            ),
        },
      },
      async ({ id, ...body }) => {
        try {
          const record = await apiPatch<EduframeRecord>(`/catalog/variants/${id}`, body);
          void logResponse("update_catalog_variant", { id, ...body }, record);
          return formatUpdate(record, "catalog variant");
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • The apiPatch helper function used by the handler to send a PATCH request to /catalog/variants/{id}. It handles authentication via API token and JSON serialization of the request body.
    export async function apiPatch<T>(path: string, body: unknown): Promise<T> {
      const { token } = getConfig();
      const url = buildUrl(path);
    
      const response = await fetch(url.toString(), {
        method: "PATCH",
        headers: buildHeaders(token),
        body: JSON.stringify(body),
      });
    
      return handleResponse<T>(response);
    }
  • The formatUpdate helper function used by the handler to format the updated catalog variant record into a readable response string.
    export function formatUpdate(record: EduframeRecord, resourceName: string): CallToolResult {
      return {
        content: [
          {
            type: "text",
            text: `Successfully updated ${resourceName}:\n\n${formatJSON(record)}${RESPONSE_LOG_HINT}`,
          },
        ],
      };
    }
Behavior2/5

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

Annotations already indicate mutability (readOnlyHint false) and idempotency. The description only repeats the 'update' action, adding no additional behavioral context such as partial update support, required permissions, or effects on related data.

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

Conciseness2/5

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

The description is extremely brief (3 words). While not verbose, it is under-specified for a tool with 3 parameters and missing critical context. Conciseness should not sacrifice necessary information.

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?

Given the complexity of updating a catalog variant (3 parameters, including a nested array), the description lacks information about return values, error handling, or side effects. Annotations provide some context, but the description does not build on them.

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?

Input schema has 100% coverage with descriptions for all parameters, so baseline is 3. The description adds no parameter-specific details, but the schema itself is sufficient for understanding parameter purposes.

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 'Update a catalog variant' clearly identifies the verb (update) and the resource (catalog variant), distinguishing it from related tools like create_catalog_variant or get_catalog_variant. However, it lacks specificity about what aspects of the variant can be updated.

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 (e.g., update_catalog_product, create_catalog_variant). No prerequisites, limitations, or context for appropriate use are mentioned.

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