list_transactions
View complete billing history including top-ups, call charges, number rentals, and refunds to track telephony expenses and account activity.
Instructions
List billing transactions — top-ups, call charges, number rentals, refunds.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/billing.ts:49-57 (handler)Main handler implementation for list_transactions tool - executes the API call to fetch billing transactions
server.registerTool( "list_transactions", { description: "List billing transactions — top-ups, call charges, number rentals, refunds.", inputSchema: {}, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }, }, async () => callTool(() => client.get("/billing/transactions")) ); - src/tools/billing.ts:49-57 (registration)Registration of the list_transactions tool with the MCP server including metadata and handler binding
server.registerTool( "list_transactions", { description: "List billing transactions — top-ups, call charges, number rentals, refunds.", inputSchema: {}, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }, }, async () => callTool(() => client.get("/billing/transactions")) ); - src/tools/billing.ts:52-53 (schema)Input schema definition for list_transactions - empty object indicates no parameters required
description: "List billing transactions — top-ups, call charges, number rentals, refunds.", inputSchema: {}, - src/tools/billing.ts:13-20 (helper)callTool helper function that wraps tool execution with standardized error handling and result formatting
async function callTool<T>(fn: () => Promise<T>) { try { return toolResult(await fn()); } catch (err) { const apiErr = err as ApiError; return toolError(`API error (${apiErr.status}): ${apiErr.message}`); } } - src/client.ts:21-31 (helper)BubblyPhoneClient.get() method that makes the actual HTTP GET request to the billing/transactions endpoint
async get<T = unknown>(path: string, params?: Record<string, string>): Promise<T> { const url = new URL(`${this.baseUrl}${path}`); if (params) { for (const [key, value] of Object.entries(params)) { if (value !== undefined && value !== "") { url.searchParams.set(key, value); } } } return this.request<T>(url.toString(), { method: "GET" }); }