Skip to main content
Glama

delete_subscription

Delete a subscription using its ID. Consider archiving instead to end subscriptions without removing records.

Instructions

Delete a subscription. DELETE /subscriptions/{subscriptionId}. Warning: Prefer changing status to archived (update_subscription_status) instead of deleting when you want to end a subscription without removing it from records.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subscriptionIdYesSubscription ID (required)

Implementation Reference

  • The handler function that executes the delete_subscription tool logic. It validates input via Zod schema, then calls subscriptionService.deleteSubscription().
    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(() =>
        subscriptionService.deleteSubscription(client, parsed.data.subscriptionId)
      );
    }
  • The tool definition including name 'delete_subscription', description, and input schema (requires subscriptionId string).
    const definition = {
      name: "delete_subscription",
      description:
        "Delete a subscription. DELETE /subscriptions/{subscriptionId}. Warning: Prefer changing status to archived (update_subscription_status) instead of deleting when you want to end a subscription without removing it from records.",
      inputSchema: {
        type: "object" as const,
        properties: {
          subscriptionId: { type: "string", description: "Subscription ID (required)" },
        },
        required: ["subscriptionId"],
      },
    };
  • Zod validation schema for the tool input, requiring 'subscriptionId' as a non-empty string.
    const schema = z.object({
      subscriptionId: z.string().min(1, "subscriptionId is required"),
    });
  • Registration of deleteSubscriptionTool in the registerSubscriptionTools() array, making it available as a tool.
    deleteSubscriptionTool,
  • The service helper function that performs the actual HTTP DELETE request to /subscriptions/{subscriptionId}.
    export async function deleteSubscription(
      client: Client,
      subscriptionId: string
    ): Promise<Record<string, unknown>> {
      const result = await client.delete<Record<string, unknown>>(
        `/subscriptions/${subscriptionId}`
      );
      return Object.keys(result ?? {}).length ? result : { success: true, message: "Subscription deleted" };
    }
Behavior3/5

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

With no annotations provided, the description must disclose behavioral traits. It mentions the HTTP method and gives a warning, but lacks explicit statements about irreversibility, authorization needs, or side effects on related data. The warning implies permanence, but more detail would improve transparency.

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 extraneous words. The main action is first, followed by the crucial warning. Efficient and well-structured.

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

Completeness4/5

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

Given the simple one-parameter delete operation and no output schema, the description is sufficiently complete. It states the action, HTTP method, and provides usage guidance. The only minor gap is the lack of explicit note about return values or confirmation of deletion.

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%, and the description does not add any additional meaning to the 'subscriptionId' parameter beyond what is already in the input schema description ('Subscription ID (required)'). Baseline score of 3 applies.

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 action ('Delete a subscription'), the resource ('subscription'), and the HTTP method. It distinguishes from siblings by warning about preferring archiving over deletion, naming the alternative tool 'update_subscription_status'.

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

Usage Guidelines5/5

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

Explicitly tells when to use this tool vs. the alternative: 'Prefer changing status to archived ... instead of deleting when you want to end a subscription without removing it from records.' This provides clear context for appropriate use.

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