Skip to main content
Glama

update_product

Modify a product's name, category, description, internal product ID, or SKU by providing the product ID and the fields to update.

Instructions

Update a product. PUT /products/{productId}. Optional: name, category, description, internalProductId, sku.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
productIdYesProduct ID (required)
nameNoProduct name
categoryNoCategory
descriptionNoDescription
internalProductIdNoInternal product ID
skuNoSKU

Implementation Reference

  • Handler function for the update_product tool. Parses input with Zod schema, extracts productId and remaining body fields, then calls productService.updateProduct.
    async function handler(client: Client, args: Record<string, unknown> | undefined) {
      const parsed = schema.safeParse(args);
      if (!parsed.success) {
        return errorResult(parsed.error.errors.map((e) => e.message).join("; "));
      }
      const { productId, ...body } = parsed.data;
      return handleToolCall(() => productService.updateProduct(client, productId, body));
    }
  • Zod input schema for update_product: requires productId, optional fields: name, category, description, internalProductId, sku.
    const schema = z.object({
      productId: z.string().min(1, "productId is required"),
      name: z.string().optional(),
      category: z.string().optional(),
      description: z.string().optional(),
      internalProductId: z.string().optional(),
      sku: z.string().optional(),
    });
  • UpdateProductBody TypeScript interface with optional fields: name, category, description, internalProductId, sku, effectiveStartDate, effectiveEndDate.
    export interface UpdateProductBody {
      name?: string;
      category?: string;
      description?: string;
      internalProductId?: string;
      sku?: string;
      effectiveStartDate?: string;
      effectiveEndDate?: string;
    }
  • Tool definition (name: 'update_product') with inputSchema describing the JSON properties for MCP tools/list registration.
    const definition = {
      name: "update_product",
      description:
        "Update a product. PUT /products/{productId}. Optional: name, category, description, internalProductId, sku.",
      inputSchema: {
        type: "object" as const,
        properties: {
          productId: { type: "string", description: "Product ID (required)" },
          name: { type: "string", description: "Product name" },
          category: { type: "string", description: "Category" },
          description: { type: "string", description: "Description" },
          internalProductId: { type: "string", description: "Internal product ID" },
          sku: { type: "string", description: "SKU" },
        },
        required: ["productId"],
      },
    };
  • Exported updateProductTool constant combining definition and handler as a Tool object.
    export const updateProductTool: Tool = {
      definition,
      handler,
    };
Behavior2/5

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

No annotations are provided, and the description only states the action and fields. It does not disclose behavioral traits such as whether the update is partial or replaces the entire resource, error handling, idempotency, or permissions required.

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

Conciseness5/5

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

The description is extremely concise: a single sentence followed by a list of fields. Every word serves a purpose, and key information (HTTP method, optional fields) is front-loaded.

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?

While the tool is simple with no output schema and well-understood parameters, the description omits details like success response format, error scenarios, or behavior when non-existent productId is provided. It is adequate but not thorough.

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 schema already details each parameter. The description adds the HTTP method and specifies that the listed fields are optional, but does not enhance meaning beyond the schema. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Update a product') and specifies the HTTP method and endpoint. It lists the updatable fields, making the tool's purpose unambiguous and distinct from siblings like create_product or delete_product.

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. It does not mention prerequisites, such as the product must exist, nor does it differentiate from other update tools like update_product_rate_plan.

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/rhinosaas/rebillia-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server