Skip to main content
Glama

delete_product

Permanently delete a product and all its associated rate plans and related data. Provide the product ID to remove the product completely.

Instructions

Delete a product. DELETE /products/{productId}. Warning: This also deletes associated rate plans and related data (cascading deletion).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
productIdYesProduct ID (required)

Implementation Reference

  • The handler function that executes the delete_product logic. It validates args with Zod schema, then calls productService.deleteProduct(client, productId).
    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("; "));
      }
      return handleToolCall(() => productService.deleteProduct(client, parsed.data.productId));
    }
  • Zod schema for input validation: requires a non-empty string productId.
    const schema = z.object({
      productId: z.string().min(1, "productId is required"),
    });
  • The service function that performs the HTTP DELETE call to /products/{productId} and returns the result.
    export async function deleteProduct(
      client: Client,
      productId: string
    ): Promise<Record<string, unknown>> {
      const result = await client.delete<Record<string, unknown>>(`/products/${productId}`);
      return Object.keys(result ?? {}).length ? result : { success: true, message: "Product deleted" };
    }
  • The Tool object export containing the definition and handler.
    export const deleteProductTool: Tool = {
      definition,
      handler,
    };
  • Product tools registry function that includes deleteProductTool in the list of all product tools.
    export function registerProductTools(): Tool[] {
      return [
        listProductsTool,
        getProductTool,
        createProductTool,
        updateProductTool,
        deleteProductTool,
        updateProductStatusTool,
        linkExternalProductTool,
        unlinkExternalProductTool,
      ];
    }
    
    export { listProductsTool } from "./listProducts.js";
    export { getProductTool } from "./getProduct.js";
    export { createProductTool } from "./createProduct.js";
    export { updateProductTool } from "./updateProduct.js";
    export { deleteProductTool } from "./deleteProduct.js";
Behavior5/5

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

The description clearly discloses the cascading deletion behavior, a critical destructive side effect. With no annotations, the description fully conveys behavioral traits, including the irreversible impact on associated entities.

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 consists of two concise sentences: first stating purpose and endpoint, second warning about cascading deletion. No redundant information; every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (single parameter, no output schema), the description fully covers what the agent needs: action, resource, HTTP method, and critical side effect. It is complete for its complexity level.

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?

The input schema has 100% description coverage for the single parameter 'productId' as 'Product ID (required)'. The description adds the HTTP endpoint and cascading warning but no additional parameter-specific semantics. 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 explicitly states 'Delete a product' and provides the HTTP endpoint, clearly indicating the action and resource. It differentiates from sibling delete tools (e.g., delete_currency) by focusing on product and associated data.

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

Usage Guidelines4/5

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

The description warns about cascading deletion of associated rate plans and related data, implying caution and when not to use it (if you want to keep linked data). It lacks explicit 'use when' or alternatives, but the warning provides strong guidance.

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