Skip to main content
Glama

get_product_rate_plan_charge

Retrieve a specific product rate plan charge by ID to get its detailed attributes and settings.

Instructions

Get a rate plan charge by ID. GET /product-rateplan-charges/{chargeId}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chargeIdYesRate plan charge ID
includeNoAttributes to include

Implementation Reference

  • Handler function for get_product_rate_plan_charge - parses args (chargeId, include), delegates to chargeService.getRatePlanCharge
    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 { chargeId, include } = parsed.data;
      return handleToolCall(() => chargeService.getRatePlanCharge(client, chargeId, { include }));
    }
  • Zod schema validating chargeId (required string) and include (optional string)
    const schema = z.object({
      chargeId: z.string().min(1, "chargeId is required"),
      include: z.string().optional(),
    });
  • Tool registration - getRatePlanChargeTool is exported and included in the registerProductRatePlanChargeTools array
    /** All 5 product rate plan charge tools. */
    export function registerProductRatePlanChargeTools(): Tool[] {
      return [
        listRatePlanChargesTool,
        getRatePlanChargeTool,
        createRatePlanChargeTool,
        updateRatePlanChargeTool,
        deleteRatePlanChargeTool,
      ];
    }
    
    export { listRatePlanChargesTool } from "./listRatePlanCharges.js";
    export { getRatePlanChargeTool } from "./getRatePlanCharge.js";
    export { createRatePlanChargeTool } from "./createRatePlanCharge.js";
    export { updateRatePlanChargeTool } from "./updateRatePlanCharge.js";
    export { deleteRatePlanChargeTool } from "./deleteRatePlanCharge.js";
  • executeTool dispatches by name - finds tool by definition.name matching 'get_product_rate_plan_charge'
    export async function executeTool(
      name: string,
      args: Record<string, unknown> | undefined,
      client: RebilliaClient
    ): Promise<ToolResult | undefined> {
      const tool = tools.find((t) => t.definition.name === name);
      if (!tool) return undefined;
      return tool.handler(client, args);
    }
  • Service layer - makes the actual GET /product-rateplan-charges/{chargeId} API call
    export async function getRatePlanCharge(
      client: Client,
      chargeId: 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>(`/product-rateplan-charges/${chargeId}${q ? `?${q}` : ""}`);
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of disclosing behavioral traits. It only states 'Get a rate plan charge by ID,' implying a read operation, but misses key details like authentication requirements, error handling for missing IDs, rate limits, or any side effects. This is insufficient for an agent to fully understand the tool's behavior.

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, consisting of two short sentences that convey the essential information without any fluff. Every word earns its place, making it easy to parse quickly.

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?

For a simple retrieval tool with two parameters and no output schema, the description is minimally adequate but lacks completeness. It does not mention the response structure (e.g., returns the rate plan charge object) or any pagination or error behavior. Given the tool's simplicity, a score of 3 reflects that it meets basic needs but leaves gaps.

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 description coverage is 100%, so the schema already documents both parameters. The description adds the REST path, which clarifies that chargeId is a path parameter, but does not elaborate on the 'include' parameter beyond the schema. Since the schema does the heavy lifting, 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 retrieves a rate plan charge by ID, using a specific verb and resource. It also includes the REST endpoint, which reinforces the purpose. Among siblings, it distinguishes itself by specifying 'rate plan charge' rather than 'product rate plan' or 'subscription rate plan charge'.

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 guidance is provided on when to use this tool versus alternatives like get_product_rate_plan or get_subscription_rate_plan_charge. There is no discussion of prerequisites, context, or when not to use it, leaving the agent to infer usage on its own.

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