Skip to main content
Glama

list_bill_runs

List bill runs with optional filters for status, related data, sorting, and pagination. Manage billing operations efficiently.

Instructions

List bill runs. GET /bill-run. Optional: include (e.g. invoice), query (filter by status: completed, pending, error), orderBy, sortBy, itemPerPage, pageNo.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includeNoInclude related data (e.g. invoice)
queryNoFilter by status: completed, pending, or error
orderByNoSort column
sortByNoSort direction
itemPerPageNoItems per page
pageNoNoPage number

Implementation Reference

  • The handler function that executes the list_bill_runs tool logic. It parses args with Zod, then calls billRunService.listBillRuns(client, parsed.data).
    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("; "));
      }
      return handleToolCall(() => billRunService.listBillRuns(client, parsed.data));
    }
    
    export const listBillRunsTool: Tool = {
      definition,
      handler,
    };
  • Zod schema for input validation of list_bill_runs (include, query, orderBy, sortBy, itemPerPage, pageNo).
    const schema = z.object({
      include: z.string().optional(),
      query: z.enum(statusEnum).optional(),
      orderBy: z.string().optional(),
      sortBy: z.string().optional(),
      itemPerPage: z.number().int().min(1).optional(),
      pageNo: z.number().int().min(1).optional(),
    });
  • Tool definition registration with name 'list_bill_runs', description, and inputSchema for MCP.
    const definition = {
      name: "list_bill_runs",
      description:
        "List bill runs. GET /bill-run. Optional: include (e.g. invoice), query (filter by status: completed, pending, error), orderBy, sortBy, itemPerPage, pageNo.",
      inputSchema: {
        type: "object" as const,
        properties: {
          include: { type: "string", description: "Include related data (e.g. invoice)" },
          query: {
            type: "string",
            description: "Filter by status: completed, pending, or error",
          },
          orderBy: { type: "string", description: "Sort column" },
          sortBy: { type: "string", description: "Sort direction" },
          itemPerPage: { type: "number", description: "Items per page" },
          pageNo: { type: "number", description: "Page number" },
        },
        required: [],
      },
    };
    
    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("; "));
      }
      return handleToolCall(() => billRunService.listBillRuns(client, parsed.data));
    }
    
    export const listBillRunsTool: Tool = {
  • Central tool registry that includes registerBillRunTools() which registers listBillRunsTool.
      const tool = tools.find((t) => t.definition.name === name);
      if (!tool) return undefined;
      return tool.handler(client, args);
    }
  • The actual API call to GET /bill-run with query params (include, query, orderBy, sortBy, itemPerPage, pageNo).
    /** GET /bill-run */
    export async function listBillRuns(
      client: Client,
      params?: ListBillRunsParams
    ): Promise<PaginatedResponse<unknown>> {
      const search = new URLSearchParams();
      if (params?.include) search.append("include", params.include);
      if (params?.query) search.append("query", params.query);
      if (params?.orderBy) search.append("orderBy", params.orderBy);
      if (params?.sortBy) search.append("sortBy", params.sortBy);
      if (params?.itemPerPage != null) search.append("itemPerPage", String(params.itemPerPage));
      if (params?.pageNo != null) search.append("pageNo", String(params.pageNo));
      const q = search.toString();
      return client.get<PaginatedResponse<unknown>>(`/bill-run${q ? `?${q}` : ""}`);
    }
Behavior3/5

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

No annotations provided, so description carries the transparency burden. It discloses the HTTP method (GET) implying idempotence and mentions pagination via itemPerPage/pageNo, but does not explicitly state it is read-only or safe. Lacks details on authorization, rate limits, or side effects.

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?

Description is very concise with a single sentence and parameter list. It front-loads the main action, though it could be more structured. Does not waste words.

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?

Lacks return format description and does not explain what a bill run is. For a list tool with no output schema, the description should compensate by stating it returns a list of bill runs, which it does not. Incomplete relative to the available context.

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%, and the description adds marginal context (e.g., example values for include/query). Baseline of 3 is appropriate as the schema already documents all parameters adequately.

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?

Description clearly states 'List bill runs' and provides the HTTP endpoint. It is a specific verb+resource purpose that distinguishes it from sibling tools like get_bill_run (singular) and other list/CRUD tools.

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 on when to use this tool versus alternatives (e.g., get_bill_run for a single bill run). No when-not or exclusions are 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