list_integrations
List company integrations by type, including ecommerce, email, marketing, tax, shipping, accounting, and chat. Filter results to find relevant integrations quickly.
Instructions
List company integrations. GET /integrations. Optional: type (ecommerce, email, marketing, tax, shipping, accounting, chat).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Filter by integration type: ecommerce, email, marketing, tax, shipping, accounting, chat |
Implementation Reference
- The handler function that executes the list_integrations tool logic. It parses args with Zod schema, then calls integrationService.listIntegrations() with the optional type filter.
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(() => integrationService.listIntegrations(client, parsed.data)); } export const listIntegrationsTool: Tool = { definition, handler, }; - Zod validation schema defining the optional 'type' parameter (enum of integration types: ecommerce, email, marketing, tax, shipping, accounting, chat).
const schema = z.object({ type: z.enum(INTEGRATION_TYPES).optional(), }); - Tool definition with name 'list_integrations', description, and input JSON Schema (type filter parameter, not required).
const definition = { name: "list_integrations", description: "List company integrations. GET /integrations. Optional: type (ecommerce, email, marketing, tax, shipping, accounting, chat).", inputSchema: { type: "object" as const, properties: { type: { type: "string", description: "Filter by integration type: ecommerce, email, marketing, tax, shipping, accounting, chat", }, }, required: [], }, }; - src/tools/integrations/index.ts:16-27 (registration)Registration of listIntegrationsTool in the registerIntegrationTools() function which returns all integration tools as an array.
export function registerIntegrationTools(): Tool[] { return [ listIntegrationsTool, getIntegrationConfigTool, getIntegrationByKeyTool, listIntegrationsByKeyTool, listExternalInvoicesTool, listExternalProductsTool, getExternalProductTool, listOrderStatusesTool, ]; } - The service layer function that makes the actual GET /integrations API call with optional query parameters (type, include, itemPerPage, pageNo).
export async function listIntegrations( client: Client, params?: ListIntegrationsParams ): Promise<unknown> { const search = new URLSearchParams(); if (params?.type) search.append("type", params.type); 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>(`/integrations${q ? `?${q}` : ""}`); }