Skip to main content
Glama

get_subscription_upcoming_charges

Retrieve all upcoming charges for a subscription, including recurring, one-time, and usage fees with amounts and due dates.

Instructions

View all upcoming charges for a subscription. GET /subscriptions/{subscriptionId}/upcoming. Returns scheduled charges (recurring, one-time, usage) with amounts and dates. Optional: include.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subscriptionIdYesSubscription ID (required)
includeNoAttributes to include

Implementation Reference

  • The handler function that executes the get_subscription_upcoming_charges tool logic. It parses args (subscriptionId, optional include) and delegates to subscriptionService.getSubscriptionUpcomingCharges.
    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, include } = parsed.data;
      return handleToolCall(() =>
        subscriptionService.getSubscriptionUpcomingCharges(client, subscriptionId, { include })
      );
    }
  • Zod schema for the tool's input: subscriptionId (required string) and include (optional string).
    const schema = z.object({
      subscriptionId: z.string().min(1, "subscriptionId is required"),
      include: z.string().optional(),
    });
  • Tool definition (name 'get_subscription_upcoming_charges', description, and JSON Schema inputSchema).
    const definition = {
      name: "get_subscription_upcoming_charges",
      description:
        "View all upcoming charges for a subscription. GET /subscriptions/{subscriptionId}/upcoming. Returns scheduled charges (recurring, one-time, usage) with amounts and dates. Optional: include.",
      inputSchema: {
        type: "object" as const,
        properties: {
          subscriptionId: { type: "string", description: "Subscription ID (required)" },
          include: { type: "string", description: "Attributes to include" },
        },
        required: ["subscriptionId"],
      },
    };
  • The exported Tool object combining the definition and handler.
    export const getSubscriptionUpcomingChargesTool: Tool = {
      definition,
      handler,
    };
  • The service function that makes the actual API call: GET /subscriptions/{subscriptionId}/upcoming with optional include parameter.
    /** Upcoming charges for the subscription. GET /subscriptions/{id}/upcoming */
    export async function getSubscriptionUpcomingCharges(
      client: Client,
      subscriptionId: string,
      params?: SubscriptionUpcomingParams
    ): Promise<unknown> {
      const search = new URLSearchParams();
      if (params?.include) search.append("include", params.include);
      const q = search.toString();
      return client.get<unknown>(`/subscriptions/${subscriptionId}/upcoming${q ? `?${q}` : ""}`);
    }
Behavior3/5

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

Discloses that the tool returns scheduled charges with amounts and dates, and indicates a GET request (read-only). With no annotations, the description provides basic transparency but omits details like authentication, rate limits, or whether all charges are returned.

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?

Two sentences with front-loaded purpose: first sentence states the action and resource, second provides additional type details. Efficient but could be more concise by merging or removing the URL.

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?

Covers the return type (scheduled charges) and key fields (amounts, dates) but lacks structural details of the response, and does not elaborate on the 'include' parameter options. Adequate for a read tool, but could be more complete.

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 clear descriptions for both parameters. The description only adds that 'include' is optional, which is already evident from the schema. The URL pattern is informative but not about the parameters themselves. Baseline 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?

Clearly states the tool views upcoming charges for a subscription, lists charge types (recurring, one-time, usage) with amounts and dates, and includes the HTTP endpoint. Distinguishes from siblings like get_subscription or get_subscription_invoices by specifying a different resource and action.

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 explicit guidance on when to use this tool versus alternatives such as get_subscription_invoices or list_subscriptions. The mention of 'Optional: include' hint at filtering but does not help the agent choose among sibling tools.

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