Skip to main content
Glama

delete_customer

Delete a customer by ID. Warning: Cascading delete may remove or orphan related data like addresses, payment methods, subscriptions, and invoices. Use with caution.

Instructions

Delete a customer by ID. DELETE /customers/{customerId}. WARNING: Cascading delete may remove or orphan related data (addresses, payment methods, subscriptions, invoices, etc.). Use with caution.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
customerIdYesCustomer ID to delete (required)

Implementation Reference

  • The handler function that validates input via zod schema and calls customerService.deleteCustomer to perform the deletion.
    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(() => customerService.deleteCustomer(client, parsed.data.customerId));
  • Zod schema defining the input: customerId (string, required).
    const schema = z.object({
      customerId: z.string().min(1, "customerId is required"),
    });
  • Export of the Tool object combining definition and handler for the delete_customer tool.
    export const deleteCustomerTool: Tool = {
      definition,
      handler,
    };
  • registerCustomerTools() includes deleteCustomerTool in the array of exported tools.
    export function registerCustomerTools(): Tool[] {
      return [
        listCustomersTool,
        getCustomerTool,
        createCustomerTool,
        updateCustomerTool,
        deleteCustomerTool,
  • Service function that performs the DELETE /customers/{customerId} HTTP request.
    export async function deleteCustomer(
      client: Client,
      customerId: string
    ): Promise<Record<string, unknown>> {
      const result = await client.delete<Record<string, unknown>>(`/customers/${customerId}`);
      return Object.keys(result ?? {}).length ? result : { success: true, message: "Customer disabled" };
    }
Behavior4/5

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

Given no annotations, the description discloses the critical cascading delete behavior affecting related data. However, it does not mention authorization requirements, idempotency, or what happens if the customer ID is invalid.

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?

Two sentences with no waste. Action is front-loaded and warning is clearly presented.

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?

Adequately covers the destructive nature and cascading effects, but lacks information on response format, error handling, or what to expect on success/failure.

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 coverage is 100% with a description for customerId. The description adds no new parameter semantics beyond what the schema provides.

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 'Delete a customer by ID' with a specific verb and resource. It distinguishes from siblings like create_customer, update_customer, and get_customer.

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?

Includes a warning about cascading delete but does not explicitly state when to use this tool versus alternatives (e.g., deactivating a customer via update_customer). No prerequisites or context provided.

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