Skip to main content
Glama

update_catalog_product

Idempotent

Update a catalog product by providing its ID and optional fields like category, publication status, custom properties, or course tab contents.

Instructions

Update a catalog product

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the catalog product to update
category_idNoIdentifier of the category of the course.
is_publishedNoBoolean showing if the product is published or not.
customNoThe custom properties of the product.
course_tab_contents_attributesNo

Implementation Reference

  • The handler function registered for the 'update_catalog_product' tool. It destructures `id` from the body, calls `apiPatch` on `/catalog/products/{id}`, logs the response, and returns a formatted update result.
    server.registerTool(
      "update_catalog_product",
      {
        description: "Update a catalog product",
        annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
        inputSchema: {
          id: z.number().int().positive().describe("ID of the catalog product to update"),
          category_id: z.number().int().optional().describe("Identifier of the category of the course."),
          is_published: z.boolean().optional().describe("Boolean showing if the product is published or not."),
          custom: z.object({}).optional().describe("The custom properties of the product."),
          course_tab_contents_attributes: z
            .array(
              z.object({
                id: z.number().int().describe("Unique identifier of the course tab content."),
                content: z.string().describe("The HTML content of the course tab."),
                course_tab_id: z.number().int().describe("Unique identifier of the course tab."),
              }),
            )
            .optional(),
        },
      },
      async ({ id, ...body }) => {
        try {
          const record = await apiPatch<EduframeRecord>(`/catalog/products/${id}`, body);
          void logResponse("update_catalog_product", { id, ...body }, record);
          return formatUpdate(record, "catalog product");
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • Input schema validation using Zod. Defines `id` (required, positive integer), and optional fields: `category_id`, `is_published`, `custom`, and `course_tab_contents_attributes` (array of objects with id, content, course_tab_id).
    inputSchema: {
      id: z.number().int().positive().describe("ID of the catalog product to update"),
      category_id: z.number().int().optional().describe("Identifier of the category of the course."),
      is_published: z.boolean().optional().describe("Boolean showing if the product is published or not."),
      custom: z.object({}).optional().describe("The custom properties of the product."),
      course_tab_contents_attributes: z
        .array(
          z.object({
            id: z.number().int().describe("Unique identifier of the course tab content."),
            content: z.string().describe("The HTML content of the course tab."),
            course_tab_id: z.number().int().describe("Unique identifier of the course tab."),
          }),
        )
        .optional(),
    },
  • The registration function `registerCatalogProductTools` is included in the `tools` array, which is iterated over to register all tools with the MCP server.
    registerCatalogProductTools,
  • src/tools/index.ts:6-6 (registration)
    Import of the `registerCatalogProductTools` function from the `catalog_products` module.
    import { registerCatalogProductTools } from "./catalog_products";
  • The `apiPatch` helper function used by the handler to make the PATCH request to `/catalog/products/{id}`.
    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);
    }
Behavior3/5

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

The annotations already provide idempotentHint=true and destructiveHint=false. The description does not add behavioral context beyond 'update', but it does not contradict the annotations. The description could mention idempotency or that only provided fields are modified, but it does not.

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 substance. It does not add enough value beyond the tool name. A more informative summary of updatable fields would improve it without sacrificing conciseness.

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?

The description omits any mention of return value (no output schema) and does not explain the nested structure of course_tab_contents_attributes. For a tool with nested objects and multiple parameters, more context is needed for correct usage.

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?

All parameters have descriptions in the input schema (80% coverage), and the tool description does not add any additional parameter-level meaning. Given high schema coverage, the baseline score of 3 is appropriate.

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 indicates the action (Update) and the resource (a catalog product). It distinguishes the tool from siblings like get_catalog_product (read) and update_catalog_variant (different resource). However, it lacks specificity about the fields that can be updated, which is partially covered by the schema.

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 is provided on when to use this tool vs. alternatives. There are siblings like update_course and update_catalog_variant, but the description offers no context for selecting this tool. There is no mention of prerequisites or when not to use it.

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