Skip to main content
Glama

remove_subscription_rate_plan

Remove a rate plan from an existing subscription. Specify the subscription ID and rate plan ID to delete.

Instructions

Remove a rate plan from a subscription. DELETE /subscriptions/{subscriptionId}/rateplans/{ratePlanId}.

Input Schema

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

Implementation Reference

  • Tool handler for remove_subscription_rate_plan. Parses subscriptionId and ratePlanId from args, validates with Zod schema, then delegates to subscriptionService.removeSubscriptionRatePlan.
    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, ratePlanId } = parsed.data;
      return handleToolCall(() =>
        subscriptionService.removeSubscriptionRatePlan(client, subscriptionId, ratePlanId)
      );
    }
  • Zod schema and MCP input definition for remove_subscription_rate_plan. Requires subscriptionId and ratePlanId (both strings).
    const schema = z.object({
      subscriptionId: z.string().min(1, "subscriptionId is required"),
      ratePlanId: z.string().min(1, "ratePlanId is required"),
    });
    
    const definition = {
      name: "remove_subscription_rate_plan",
      description:
        "Remove a rate plan from a subscription. DELETE /subscriptions/{subscriptionId}/rateplans/{ratePlanId}.",
      inputSchema: {
        type: "object" as const,
        properties: {
          subscriptionId: { type: "string", description: "Subscription ID (required)" },
          ratePlanId: { type: "string", description: "Subscription rate plan ID to remove (required)" },
        },
        required: ["subscriptionId", "ratePlanId"],
      },
    };
  • Registration of remove_subscription_rate_plan via removeSubscriptionRatePlanTool in the registerSubscriptionTools() array.
    export function registerSubscriptionTools(): Tool[] {
      return [
        listSubscriptionsTool,
        getSubscriptionTool,
        createSubscriptionTool,
        updateSubscriptionTool,
        deleteSubscriptionTool,
        updateSubscriptionStatusTool,
        getSubscriptionUpcomingChargesTool,
        getSubscriptionInvoicesTool,
        getSubscriptionLogsTool,
        getSubscriptionExternalInvoicesTool,
        listSubscriptionRatePlansTool,
        getSubscriptionRatePlanTool,
        addSubscriptionRatePlanTool,
        updateSubscriptionRatePlanTool,
        removeSubscriptionRatePlanTool,
        getSubscriptionRatePlanChargeTool,
        addSubscriptionRatePlanChargeTool,
        updateSubscriptionRatePlanChargeTool,
        removeSubscriptionRatePlanChargeTool,
      ];
    }
  • Re-export of removeSubscriptionRatePlanTool from the subscription tools index.
    export { removeSubscriptionRatePlanTool } from "./removeSubscriptionRatePlan.js";
  • Core service function that executes the DELETE /subscriptions/{subscriptionId}/rateplans/{ratePlanId} HTTP request via the client.
    /** Remove a rate plan from a subscription. DELETE /subscriptions/{id}/rateplans/{ratePlanId} */
    export async function removeSubscriptionRatePlan(
      client: Client,
      subscriptionId: string,
      ratePlanId: string
    ): Promise<Record<string, unknown>> {
      const result = await client.delete<Record<string, unknown>>(
        `/subscriptions/${subscriptionId}/rateplans/${ratePlanId}`
      );
      return Object.keys(result ?? {}).length ? result : { success: true, message: "Rate plan removed" };
    }
Behavior2/5

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

With no annotations provided, the description must fully disclose behavioral traits. It only states the HTTP DELETE method, implying a destructive operation, but fails to mention potential side effects (e.g., impact on subscription charges, reversibility, or dependencies on other entities).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very concise, consisting of a single sentence and the endpoint. It is front-loaded with the main action. However, it could be slightly more structured by separating the action from the endpoint, but overall it is efficient with no wasted words.

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?

The description lacks important context such as what happens on success (e.g., return value or confirmation), error scenarios, or prerequisites (e.g., cannot remove a rate plan that has charges without first removing charges). Given the presence of sibling tools like remove_subscription_rate_plan_charge, this missing context is a gap.

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, so the parameter names and descriptions are clear. The tool description does not add any additional context beyond what the schema already provides. Therefore, a 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 clearly states the tool's function: remove a rate plan from a subscription. It also provides the specific HTTP method and endpoint, making it unambiguous. The sibling tools (e.g., add_subscription_rate_plan, remove_subscription_rate_plan_charge) are distinct, so no confusion.

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?

The description does not provide explicit guidance on when to use this tool versus alternatives or any prerequisites. The purpose is implied by the name and description, but no when-not or conditional instructions are given.

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