Skip to main content
Glama

update_product_status

Update a product's status to published, archived, or disabled to control its availability in your store.

Instructions

Update a product status. PUT /products/{productId}/status. Required: status. Valid values: published, archived, disabled.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
productIdYesProduct ID (required)
statusYesStatus (required): published, archived, or disabled

Implementation Reference

  • Handler function that parses args via Zod schema, then calls productService.updateProductStatus(client, productId, status).
    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, status } = parsed.data;
      return handleToolCall(() => productService.updateProductStatus(client, productId, status));
    }
  • Zod schema validating productId (string, min 1) and status (enum: published, archived, disabled).
    const statusEnum = ["published", "archived", "disabled"] as const;
    
    const schema = z.object({
      productId: z.string().min(1, "productId is required"),
      status: z.enum(statusEnum, {
        errorMap: () => ({ message: `status must be one of: ${statusEnum.join(", ")}` }),
      }),
    });
  • Tool definition (name: update_product_status, description, inputSchema) used for MCP tool registration.
    const definition = {
      name: "update_product_status",
      description:
        "Update a product status. PUT /products/{productId}/status. Required: status. Valid values: published, archived, disabled.",
      inputSchema: {
        type: "object" as const,
        properties: {
          productId: { type: "string", description: "Product ID (required)" },
          status: {
            type: "string",
            description: "Status (required): published, archived, or disabled",
          },
        },
        required: ["productId", "status"],
      },
    };
  • Export of updateProductStatusTool as a Tool object combining definition and handler.
    export const updateProductStatusTool: Tool = {
      definition,
      handler,
    };
  • Import of updateProductStatusTool from its module.
    import { updateProductStatusTool } from "./updateProductStatus.js";
  • updateProductStatusTool included in the registerProductTools() array that returns all product tools.
    updateProductStatusTool,
  • Service function that calls PUT /products/{productId}/status with the new status value.
    export async function updateProductStatus(
      client: Client,
      productId: string,
      status: ProductStatus
    ): Promise<unknown> {
      return client.put<unknown>(`/products/${productId}/status`, { status });
    }
  • ProductStatus type alias (published | archived | disabled) used by the service.
    /** Product status (ProductValidator::validateStatus – published, archived, disabled) */
    export type ProductStatus = "published" | "archived" | "disabled";
Behavior2/5

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

No annotations provided. Description indicates a mutation (PUT) but fails to disclose side effects, authorization needs, or whether the operation is idempotent. Lacks behavioral context beyond the action and valid values.

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?

Description is concise with three short sentences. Front-loads the core action, includes endpoint, and lists constraints without unnecessary elaboration.

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?

Simple task with adequate parameter coverage, but no output schema description. Lacks mention of error conditions, prerequisites (e.g., product must exist), or impact on related entities. Minimal but functional.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and already describes parameters. Description adds the HTTP context and explicitly lists valid values (published, archived, disabled), which are not present as enums in the schema, thus adding meaningful extra guidance.

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?

Description clearly states 'Update a product status' with specific verb and resource. Includes HTTP method and endpoint, and lists valid status values. Distinguishes from siblings like update_product and update_product_rate_plan_status by focusing on status only.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides required parameter and valid values, but no explicit guidance on when to use vs alternatives (e.g., update_product) or potential side effects. Usage is implied rather than clarified.

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