Skip to main content
Glama

delete_product_rate_plan

Remove a product rate plan by providing its rate plan ID. This action permanently deletes the specified rate plan from your subscription billing system.

Instructions

Delete a rate plan. DELETE /product-rateplans/{ratePlanId}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ratePlanIdYesRate plan ID (URI: /product-rateplans/{ratePlanId})

Implementation Reference

  • The handler function for the delete_product_rate_plan tool. Parses the 'ratePlanId' argument from the input, validates it using Zod, and delegates to the service layer's deleteRatePlan function.
    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(() => ratePlanService.deleteRatePlan(client, parsed.data.ratePlanId));
    }
  • Zod schema and MCP inputSchema definition for the delete_product_rate_plan tool. Expects a required 'ratePlanId' string.
    const schema = z.object({
      ratePlanId: z.string().min(1, "ratePlanId is required"),
    });
    
    const definition = {
      name: "delete_product_rate_plan",
      description: "Delete a rate plan. DELETE /product-rateplans/{ratePlanId}.",
      inputSchema: {
        type: "object" as const,
        properties: {
          ratePlanId: { type: "string", description: "Rate plan ID (URI: /product-rateplans/{ratePlanId})" },
        },
        required: ["ratePlanId"],
      },
    };
  • Registration of the deleteRatePlanTool (which includes delete_product_rate_plan) in the product rate plan tools array, collected into the main tool registry.
    /** All 7 product rate plan tools. */
    export function registerProductRatePlanTools(): Tool[] {
      return [
        listRatePlansTool,
        getRatePlanTool,
        createRatePlanTool,
        updateRatePlanTool,
        deleteRatePlanTool,
        updateRatePlanStatusTool,
        syncRatePlanTool,
      ];
  • Main tool registry where registerProductRatePlanTools() is called and tools are stored. The executeTool function looks up tools by name (including 'delete_product_rate_plan') to dispatch calls.
    const tools: Tool[] = [
      ...registerCustomerTools(),
      ...registerProductTools(),
      ...registerProductRatePlanTools(),
      ...registerProductRatePlanChargeTools(),
      ...registerSubscriptionTools(),
      ...registerInvoiceTools(),
      ...registerTransactionTools(),
      ...registerBillRunTools(),
      ...registerGatewayTools(),
      ...registerCurrencyTools(),
      ...registerIntegrationTools(),
      ...registerShippingTools(),
      ...registerFilterTools(),
      ...registerDocsTools(),
    ];
    
    /** All tool definitions for tools/list */
    export function getToolDefinitions(): ToolDefinition[] {
      return tools.map((t) => t.definition);
    }
    
    /** Execute a tool by name. Returns result or undefined if tool not found. */
    export async function executeTool(
      name: string,
      args: Record<string, unknown> | undefined,
      client: RebilliaClient
    ): Promise<ToolResult | undefined> {
      const tool = tools.find((t) => t.definition.name === name);
      if (!tool) return undefined;
      return tool.handler(client, args);
    }
  • The actual service function that performs the DELETE HTTP request to /product-rateplans/{ratePlanId}. Called by the handler.
    export async function deleteRatePlan(
      client: Client,
      ratePlanId: string
    ): Promise<Record<string, unknown>> {
      const result = await client.delete<Record<string, unknown>>(
        `/product-rateplans/${ratePlanId}`
      );
      return Object.keys(result ?? {}).length ? result : { success: true, message: "Rate plan deleted" };
    }
Behavior2/5

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

No annotations provided. The description only says 'Delete' which implies destruction, but does not disclose consequences, irreversibility, permissions required, or any side effects. The agent gets no behavioral context beyond the verb.

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?

Extremely concise: one sentence plus the endpoint. No wasted words, effectively communicates the essential information.

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?

For a simple delete with one parameter and no output schema, the description is minimal but lacks behavioral context (e.g., whether it supports cascading deletes). It does not sufficiently differentiate from other delete tools on the server.

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?

Input schema has 100% coverage with a clear description for 'ratePlanId'. The tool description adds no additional parameter meaning beyond the schema, so baseline score of 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 rate plan' and provides the HTTP endpoint, making the action and resource clear. It distinguishes from siblings like 'create_product_rate_plan' or 'update_product_rate_plan'.

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 on when to use this tool vs alternatives, no prerequisites or conditions (e.g., whether rate plan can be deleted if active subscriptions exist). The description lacks any contextual usage advice.

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