Skip to main content
Glama

get_subscription

Retrieve a subscription's details by its unique ID. Optionally include additional attributes for comprehensive data.

Instructions

Get a subscription by ID. GET /subscriptions/{subscriptionId}. Optional: include.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subscriptionIdYesSubscription ID (required)
includeNoAttributes to include

Implementation Reference

  • Handler function that validates input via Zod schema and delegates to subscriptionService.getSubscription.
    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.getSubscription(client, subscriptionId, { include })
      );
    }
  • Zod schema for input validation: 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 with name 'get_subscription', description, and JSON Schema input schema.
    const definition = {
      name: "get_subscription",
      description: "Get a subscription by ID. GET /subscriptions/{subscriptionId}. Optional: include.",
      inputSchema: {
        type: "object" as const,
        properties: {
          subscriptionId: { type: "string", description: "Subscription ID (required)" },
          include: { type: "string", description: "Attributes to include" },
        },
        required: ["subscriptionId"],
      },
    };
  • Export of getSubscriptionTool combining definition and handler.
    export const getSubscriptionTool: Tool = {
      definition,
      handler,
    };
  • Service function that makes the actual HTTP GET request to /subscriptions/{subscriptionId} with optional include query parameter.
    export async function getSubscription(
      client: Client,
      subscriptionId: string,
      params?: { include?: string }
    ): Promise<unknown> {
      const search = new URLSearchParams();
      if (params?.include) search.append("include", params.include);
      const q = search.toString();
      return client.get<unknown>(`/subscriptions/${subscriptionId}${q ? `?${q}` : ""}`);
    }
Behavior3/5

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

With no annotations, the description bears full transparency burden. It indicates a GET operation, implying read-only behavior, but does not disclose details like error handling, response structure, or rate limits. Adequate for a simple retrieval.

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 extremely concise with only two sentences. It is front-loaded with the core purpose and includes the HTTP method for clarity.

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 simplicity of a get-by-ID operation with only two parameters, the description is mostly complete. However, the lack of output schema or mention of return format slightly reduces completeness.

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 already provides descriptions for both parameters (subscriptionId and include). The description only adds 'Optional: include,' which is redundant. Schema coverage is 100%, so baseline score 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 action (get), the resource (subscription), and the identifier (by ID), distinguishing it from sibling tools like list_subscriptions or get_customer_subscriptions. It also includes the REST endpoint for clarity.

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 implies usage when the subscription ID is known, but does not explicitly instruct when to use this tool over alternatives like get_subscription_invoices or get_subscription_logs. No context on when not to use it is provided.

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