list_currencies
List all currencies configured for your company. Filter results using optional parameters: include, items per page, and page number.
Instructions
List company currencies. GET /currencies. Optional: include, itemPerPage, pageNo.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include | No | Comma-separated attributes to include | |
| itemPerPage | No | Items per page | |
| pageNo | No | Page number |
Implementation Reference
- The handler function that parses arguments via the Zod schema and delegates to currencyService.listCurrencies.
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(() => currencyService.listCurrencies(client, parsed.data)); } - Zod schema defining input validation for the list_currencies tool (include, itemPerPage, pageNo).
const schema = z.object({ include: z.string().optional(), itemPerPage: z.number().int().min(1).optional(), pageNo: z.number().int().min(1).optional(), }); - TypeScript interface for the parameters passed to the listCurrencies service function.
export interface ListCurrenciesParams { include?: string; itemPerPage?: number; pageNo?: number; } - src/tools/currencies/listCurrencies.ts:36-39 (registration)The Tool object that wraps the definition and handler for registration.
export const listCurrenciesTool: Tool = { definition, handler, }; - The underlying service function that makes the HTTP GET /currencies call to the API.
export async function listCurrencies( client: Client, params?: ListCurrenciesParams ): Promise<unknown> { const search = new URLSearchParams(); if (params?.include) search.append("include", params.include); 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<unknown>(`/currencies${q ? `?${q}` : ""}`); }