get_bill_run
Retrieve a bill run's details by supplying its unique identifier.
Instructions
Get a bill run by ID. GET /bill-run/{billRunId}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| billRunId | Yes | Bill run ID (required) |
Implementation Reference
- src/tools/bill_runs/getBillRun.ts:23-31 (handler)The handler function that executes the get_bill_run tool logic. Validates input with Zod schema, then calls billRunService.getBillRun.
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.getBillRun(client, parsed.data.billRunId) ); } - Zod validation schema requiring billRunId (non-empty string).
const schema = z.object({ billRunId: z.string().min(1, "billRunId is required"), }); - src/tools/bill_runs/getBillRun.ts:11-21 (registration)Tool definition registering the name 'get_bill_run' with input schema and description.
const definition = { name: "get_bill_run", description: "Get a bill run by ID. GET /bill-run/{billRunId}.", inputSchema: { type: "object" as const, properties: { billRunId: { type: "string", description: "Bill run ID (required)" }, }, required: ["billRunId"], }, }; - src/tools/bill_runs/index.ts:12-24 (registration)Registration of getBillRunTool in the registerBillRunTools() array.
export function registerBillRunTools(): Tool[] { return [ listBillRunsTool, getBillRunTool, updateBillRunTool, getBillRunInvoicesTool, ]; } export { listBillRunsTool } from "./listBillRuns.js"; export { getBillRunTool } from "./getBillRun.js"; export { updateBillRunTool } from "./updateBillRun.js"; export { getBillRunInvoicesTool } from "./getBillRunInvoices.js"; - Service function that makes the actual GET /bill-run/{billRunId} API call.
/** GET /bill-run/{billRunId} */ export async function getBillRun( client: Client, billRunId: string ): Promise<unknown> { return client.get<unknown>(`/bill-run/${billRunId}`); }