delete_currency
Delete a company currency. Fails if currency is referenced in invoices, subscriptions, transactions, or gateways.
Instructions
Delete a company currency. DELETE /currencies/{companyCurrencyId}. Fails if currency is in use (invoices, subscriptions, transactions, or gateways).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| companyCurrencyId | Yes | Company currency ID (required) |
Implementation Reference
- The handler function that executes the delete_currency tool logic: validates input with Zod schema, then calls the currency service to DELETE /currencies/{companyCurrencyId}.
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.deleteCurrency(client, parsed.data.companyCurrencyId) ); } - The tool definition/schema registering the tool name 'delete_currency', description, and input validation schema (requires companyCurrencyId string).
const definition = { name: "delete_currency", description: "Delete a company currency. DELETE /currencies/{companyCurrencyId}. Fails if currency is in use (invoices, subscriptions, transactions, or gateways).", inputSchema: { type: "object" as const, properties: { companyCurrencyId: { type: "string", description: "Company currency ID (required)" }, }, required: ["companyCurrencyId"], }, }; - src/tools/currencies/index.ts:15-25 (registration)Registration function that collects all currency tools including deleteCurrencyTool into an array for the central tool registry.
export function registerCurrencyTools(): Tool[] { return [ listCurrenciesTool, getCurrencyTool, createCurrencyTool, updateCurrencyTool, deleteCurrencyTool, getDefaultCurrencyTool, setDefaultCurrencyTool, ]; } - The underlying service function that makes the actual HTTP DELETE request to /currencies/{companyCurrencyId}.
export async function deleteCurrency( client: Client, companyCurrencyId: string ): Promise<unknown> { return client.delete<unknown>(`/currencies/${companyCurrencyId}`); } - src/tools/index.ts:26-41 (registration)Central tool registry where registerCurrencyTools() is called, including deleteCurrencyTool in the master tools list.
const tools: Tool[] = [ ...registerCustomerTools(), ...registerProductTools(), ...registerProductRatePlanTools(), ...registerProductRatePlanChargeTools(), ...registerSubscriptionTools(), ...registerInvoiceTools(), ...registerTransactionTools(), ...registerBillRunTools(), ...registerGatewayTools(), ...registerCurrencyTools(), ...registerIntegrationTools(), ...registerShippingTools(), ...registerFilterTools(), ...registerDocsTools(), ];