Skip to main content
Glama

list_subscription_rate_plans

List rate plans for a subscription, with optional filters for status and type, and pagination control.

Instructions

List rate plans on a subscription. GET /subscriptions/{subscriptionId}/rateplans. Returns paginated rate plans (product rate plan ref, name, type, effectiveStartDate, charges when included). Optional: include, pageNo, itemPerPage, orderBy, sortBy, status (active|pause|cancel|archived), type (ongoing|prepaid|contract). status/type filters are case-insensitive.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subscriptionIdYesSubscription ID (required)
includeNoAttributes to include (e.g. rateplanCharge)
pageNoNoPage number
itemPerPageNoItems per page
orderByNoSort column
sortByNoSort direction
statusNoFilter by rate plan status (case-insensitive)
typeNoFilter by rate plan type (case-insensitive)

Implementation Reference

  • Handler function for list_subscription_rate_plans: parses args with Zod schema, extracts subscriptionId, calls subscriptionService.listSubscriptionRatePlans(client, subscriptionId, params), wrapped in handleToolCall for error handling.
    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, ...params } = parsed.data;
      return handleToolCall(() =>
        subscriptionService.listSubscriptionRatePlans(client, subscriptionId, params)
      );
    }
  • Exported Tool object pairing the definition with the handler function.
    export const listSubscriptionRatePlansTool: Tool = {
      definition,
      handler,
    };
  • Tool definition/inputSchema for list_subscription_rate_plans: name, description, and JSON Schema input properties (subscriptionId required; include, pageNo, itemPerPage, orderBy, sortBy, status, type optional).
    const definition = {
      name: "list_subscription_rate_plans",
      description:
        "List rate plans on a subscription. GET /subscriptions/{subscriptionId}/rateplans. Returns paginated rate plans (product rate plan ref, name, type, effectiveStartDate, charges when included). Optional: include, pageNo, itemPerPage, orderBy, sortBy, status (active|pause|cancel|archived), type (ongoing|prepaid|contract). status/type filters are case-insensitive.",
      inputSchema: {
        type: "object" as const,
        properties: {
          subscriptionId: { type: "string", description: "Subscription ID (required)" },
          include: { type: "string", description: "Attributes to include (e.g. rateplanCharge)" },
          pageNo: { type: "number", description: "Page number" },
          itemPerPage: { type: "number", description: "Items per page" },
          orderBy: { type: "string", description: "Sort column" },
          sortBy: { type: "string", description: "Sort direction" },
          status: {
            type: "string",
            enum: ["active", "pause", "cancel", "archived"],
            description: "Filter by rate plan status (case-insensitive)",
          },
          type: {
            type: "string",
            enum: ["ongoing", "prepaid", "contract"],
            description: "Filter by rate plan type (case-insensitive)",
          },
        },
        required: ["subscriptionId"],
      },
    };
  • Zod validation schema for list_subscription_rate_plans inputs: validates subscriptionId, include, pageNo, itemPerPage, orderBy, sortBy, status (case-insensitive enum), type (case-insensitive enum).
    const schema = z.object({
      subscriptionId: z.string().min(1, "subscriptionId is required"),
      include: z.string().optional(),
      pageNo: z.number().int().min(1).optional(),
      itemPerPage: z.number().int().min(1).optional(),
      orderBy: z.string().optional(),
      sortBy: z.string().optional(),
      status: z
        .preprocess(
          (value) => (typeof value === "string" ? value.toLowerCase() : value),
          z.enum(ratePlanStatuses)
        )
        .optional(),
      type: z
        .preprocess(
          (value) => (typeof value === "string" ? value.toLowerCase() : value),
          z.enum(ratePlanTypes)
        )
        .optional(),
    });
  • ListSubscriptionRatePlansParams interface and listSubscriptionRatePlans service function: builds query params from optional filters (include, pageNo, itemPerPage, orderBy, sortBy, status, type) and makes GET /subscriptions/{subscriptionId}/rateplans API call.
    export interface ListSubscriptionRatePlansParams {
      include?: string;
      pageNo?: number;
      itemPerPage?: number;
      orderBy?: string;
      sortBy?: string;
      status?: "active" | "pause" | "cancel" | "archived";
      type?: "ongoing" | "prepaid" | "contract";
    }
    
    /** List rate plans on a subscription. GET /subscriptions/{id}/rateplans */
    export async function listSubscriptionRatePlans(
      client: Client,
      subscriptionId: string,
      params?: ListSubscriptionRatePlansParams
    ): Promise<PaginatedResponse<unknown>> {
      const search = new URLSearchParams();
      if (params?.include) search.append("include", params.include);
      if (params?.pageNo != null) search.append("pageNo", String(params.pageNo));
      if (params?.itemPerPage != null) search.append("itemPerPage", String(params.itemPerPage));
      if (params?.orderBy) search.append("orderBy", params.orderBy ?? "");
      if (params?.sortBy) search.append("sortBy", params.sortBy ?? "");
      if (params?.status) search.append("status", params.status);
      if (params?.type) search.append("type", params.type);
      const q = search.toString();
      return client.get<PaginatedResponse<unknown>>(
        `/subscriptions/${subscriptionId}/rateplans${q ? `?${q}` : ""}`
      );
    }
Behavior4/5

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

No annotations are provided, but the description discloses pagination behavior, case-insensitive filters, and optional parameters. It does not mention any destructive side effects, which is appropriate for a read-only operation.

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?

The description is concise and front-loaded with the core action. Every sentence adds value without redundancy.

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

Completeness5/5

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

Given the complexity (8 parameters, no output schema), the description fully covers return values, pagination, and filtering. It is complete for an agent to select and invoke correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds significant meaning beyond the input schema: it notes that status/type filters are case-insensitive, lists return fields, and indicates pagination. The schema already provides parameter descriptions, so the description enhances understanding.

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 'List rate plans on a subscription' with specific verb and resource. It mentions the HTTP endpoint and return fields, and is clearly distinct from sibling tools like add, remove, update, and get.

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

Usage Guidelines4/5

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

The description implicitly advises when to use this tool (listing all rate plans for a subscription) but does not explicitly exclude alternatives like get_subscription_rate_plan for single plans. However, the context is clear enough.

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