Skip to main content
Glama

list_product_rate_plan_charges

Fetch product rate plan charges for a given rate plan ID. Optionally include attributes, sort, order, and paginate results to manage billing details.

Instructions

List product rate plan charges for a product rate plan. GET /product-rateplans/{ratePlanId}/product-rateplan-charges. Product rate plan reference: ratePlanId (URI: /product-rateplans/{ratePlanId}). Optional: include, orderBy, sortBy, pageNo, itemPerPage.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ratePlanIdYesProduct rate plan ID (URI: /product-rateplans/{ratePlanId})
includeNoAttributes to include
orderByNoSort column
sortByNoSort direction
pageNoNoPage number
itemPerPageNoItems per page

Implementation Reference

  • Handler function for the list_product_rate_plan_charges tool. Parses args using Zod schema, extracts ratePlanId and optional params, then calls the service layer's listRatePlanCharges function.
    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 { ratePlanId, ...params } = parsed.data;
      return handleToolCall(() => chargeService.listRatePlanCharges(client, ratePlanId, params));
    }
  • Zod schema for input validation of the list_product_rate_plan_charges tool. Accepts ratePlanId (required), include, orderBy, sortBy, pageNo, itemPerPage (optional).
    const schema = z.object({
      ratePlanId: z.string().min(1, "ratePlanId is required"),
      include: z.string().optional(),
      orderBy: z.string().optional(),
      sortBy: z.string().optional(),
      pageNo: z.number().int().min(1).optional(),
      itemPerPage: z.number().int().min(1).optional(),
    });
  • Tool definition with name 'list_product_rate_plan_charges', description, and JSON Schema input properties for the MCP protocol.
    const definition = {
      name: "list_product_rate_plan_charges",
      description:
        "List product rate plan charges for a product rate plan. GET /product-rateplans/{ratePlanId}/product-rateplan-charges. Product rate plan reference: ratePlanId (URI: /product-rateplans/{ratePlanId}). Optional: include, orderBy, sortBy, pageNo, itemPerPage.",
      inputSchema: {
        type: "object" as const,
        properties: {
          ratePlanId: { type: "string", description: "Product rate plan ID (URI: /product-rateplans/{ratePlanId})" },
          include: { type: "string", description: "Attributes to include" },
          orderBy: { type: "string", description: "Sort column" },
          sortBy: { type: "string", description: "Sort direction" },
          pageNo: { type: "number", description: "Page number" },
          itemPerPage: { type: "number", description: "Items per page" },
        },
        required: ["ratePlanId"],
      },
    };
  • Service function listRatePlanCharges that makes the actual API call. Constructs query params from optional filters and performs GET /product-rateplans/{ratePlanId}/product-rateplan-charges.
    export async function listRatePlanCharges(
      client: Client,
      ratePlanId: string,
      params?: ListRatePlanChargesParams
    ): Promise<PaginatedResponse<unknown>> {
      const search = new URLSearchParams();
      if (params?.include) search.append("include", params.include);
      if (params?.orderBy) search.append("orderBy", params.orderBy ?? "");
      if (params?.sortBy) search.append("sortBy", params.sortBy ?? "");
      if (params?.pageNo != null) search.append("pageNo", String(params.pageNo));
      if (params?.itemPerPage != null) search.append("itemPerPage", String(params.itemPerPage));
      const q = search.toString();
      return client.get<PaginatedResponse<unknown>>(
        `/product-rateplans/${ratePlanId}/product-rateplan-charges${q ? `?${q}` : ""}`
      );
    }
  • Registration of listRatePlanChargesTool in the registerProductRatePlanChargeTools function, which returns all product rate plan charge tools.
    export function registerProductRatePlanChargeTools(): Tool[] {
      return [
        listRatePlanChargesTool,
        getRatePlanChargeTool,
        createRatePlanChargeTool,
        updateRatePlanChargeTool,
        deleteRatePlanChargeTool,
      ];
    }
Behavior3/5

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

No annotations provided, so the description carries the burden. It includes the HTTP method GET, implying read-only behavior, but does not explicitly state safety, idempotency, authentication needs, or rate limits. The behavioral traits are minimally inferred but not clearly disclosed.

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?

The description is three sentences and includes the endpoint, which aids completeness. It is concise with no redundant phrasing, but could be better structured (e.g., using bullet points for parameters).

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

Completeness2/5

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

No output schema is provided, and the description does not explain the response format (e.g., array of charge objects, pagination metadata). While optional pagination parameters are listed, there is no confirmation that pagination is supported. For a list tool, this is a significant gap.

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 lists optional parameters but adds no new detail beyond the schema descriptions. For example, it does not explain valid values for 'include' or 'orderBy'. The description adds marginal value over the schema.

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 product rate plan charges for a product rate plan,' specifying the action (list), resource (charges), and scope (for a rate plan). It distinguishes from sibling tools like get_product_rate_plan_charge (singular) and create/update/delete tools.

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?

No explicit guidance on when to use this tool versus alternatives. While it mentions optional parameters, it does not explain scenarios for listing vs. getting a single charge or how filtering might work. Usage is implied but not clarified with exclusions or alternatives.

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