Skip to main content
Glama

remove_subscription_rate_plan_charge

Delete a rate plan charge from a subscription to customize billing components. This modifies recurring charges on active subscriptions.

Instructions

Remove a rate plan charge from a subscription. DELETE /subscriptions/{subscriptionId}/rateplan-charges/{chargeId}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subscriptionIdYesSubscription ID (required)
chargeIdYesSubscription rate plan charge ID to remove (required)

Implementation Reference

  • The handler function that validates inputs via Zod schema and calls the subscription service to remove a rate plan charge.
    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 { subscriptionId, chargeId } = parsed.data;
      return handleToolCall(() =>
        subscriptionService.removeSubscriptionRatePlanCharge(client, subscriptionId, chargeId)
      );
    }
  • Zod input validation schema requiring subscriptionId and chargeId.
    const schema = z.object({
      subscriptionId: z.string().min(1, "subscriptionId is required"),
      chargeId: z.string().min(1, "chargeId is required"),
    });
  • Tool definition with name 'remove_subscription_rate_plan_charge' and input schema for the MCP tool.
    const definition = {
      name: "remove_subscription_rate_plan_charge",
      description:
        "Remove a rate plan charge from a subscription. DELETE /subscriptions/{subscriptionId}/rateplan-charges/{chargeId}.",
      inputSchema: {
        type: "object" as const,
        properties: {
          subscriptionId: { type: "string", description: "Subscription ID (required)" },
          chargeId: { type: "string", description: "Subscription rate plan charge ID to remove (required)" },
        },
        required: ["subscriptionId", "chargeId"],
      },
    };
  • The tool is registered in the array returned by registerSubscriptionTools() (line 47).
    export function registerSubscriptionTools(): Tool[] {
      return [
        listSubscriptionsTool,
        getSubscriptionTool,
        createSubscriptionTool,
        updateSubscriptionTool,
        deleteSubscriptionTool,
        updateSubscriptionStatusTool,
        getSubscriptionUpcomingChargesTool,
        getSubscriptionInvoicesTool,
        getSubscriptionLogsTool,
        getSubscriptionExternalInvoicesTool,
        listSubscriptionRatePlansTool,
        getSubscriptionRatePlanTool,
        addSubscriptionRatePlanTool,
        updateSubscriptionRatePlanTool,
        removeSubscriptionRatePlanTool,
        getSubscriptionRatePlanChargeTool,
        addSubscriptionRatePlanChargeTool,
        updateSubscriptionRatePlanChargeTool,
        removeSubscriptionRatePlanChargeTool,
      ];
    }
  • The service function that performs the DELETE HTTP request to /subscriptions/{subscriptionId}/rateplan-charges/{chargeId}.
    export async function removeSubscriptionRatePlanCharge(
      client: Client,
      subscriptionId: string,
      chargeId: string
    ): Promise<Record<string, unknown>> {
      const result = await client.delete<Record<string, unknown>>(
        `/subscriptions/${subscriptionId}/rateplan-charges/${chargeId}`
      );
      return Object.keys(result ?? {}).length ? result : { success: true, message: "Charge removed" };
    }
Behavior2/5

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

No annotations exist, so description must disclose behavioral traits. It only says 'Remove' without clarifying if removal is irreversible, if it triggers billing changes, or requires specific permissions.

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, front-loaded with the action and endpoint. No redundant information; every word serves a purpose.

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

Completeness2/5

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

Given no output schema and no annotations, the description is too minimal. It lacks details on return values, error handling, idempotency, or consequences of removal.

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 description coverage is 100%, so the schema already documents both parameters. The description adds no extra meaning beyond what the schema provides, baseline 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?

Clearly states the action 'Remove' and the resource 'rate plan charge from a subscription'. Also provides the REST endpoint, which distinguishes it from sibling tools like add_subscription_rate_plan_charge or remove_subscription_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 versus alternatives (e.g., update vs. remove), no prerequisites mentioned, and no conditions for not using it.

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