get-lists
Retrieve all CRM lists from Attio including sales pipelines, lead stages, and customer segments to organize and manage customer relationship data.
Instructions
Get all CRM lists from Attio (sales pipelines, lead stages, customer segments, etc.)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/objects/lists/base.ts:22-47 (handler)The core implementation of the get-lists tool handler. Fetches all lists from the Attio API using the generic or direct API client, with fallback handling and error logging.export async function getLists( objectSlug?: string, limit: number = 20 ): Promise<AttioList[]> { try { return await getGenericLists(objectSlug, limit); } catch (error: unknown) { const errorMessage = getErrorMessage(error) ?? 'Unknown error'; if (process.env.NODE_ENV === 'development') { createScopedLogger('objects.lists', 'getLists').warn( 'Generic getLists failed', { errorMessage } ); } const api = getLazyAttioClient(); let path = `/lists?limit=${limit}`; if (objectSlug) { path += `&objectSlug=${objectSlug}`; } const response = await api.get(path); return asListArray(extract<AttioList[]>(response)); } }
- src/handlers/tool-configs/lists.ts:30-37 (registration)Registers the 'get-lists' tool configuration, specifying name, handler function, and result formatter. This config is imported into the central tool registry.getLists: { name: 'get-lists', handler: getLists, formatResult: (results: AttioList[]) => { // Return JSON string - dispatcher will convert to JSON content return JSON.stringify(Array.isArray(results) ? results : []); }, } as GetListsToolConfig,
- Defines the tool schema including name, description, and empty input schema (no parameters required). Used for MCP tool discovery.{ name: 'get-lists', description: formatToolDescription({ capability: 'Retrieve all CRM lists (sales pipelines, lead stages, customer segments).', boundaries: 'create or modify lists, only reads existing lists.', constraints: 'Returns all lists visible to the authenticated workspace.', recoveryHint: 'Use get-list-details to inspect individual list schemas.', }), inputSchema: { type: 'object', properties: {}, additionalProperties: false, }, },
- src/handlers/tools/registry.ts:70-89 (registration)Central tool registry where listsToolConfigs (containing get-lists) is registered under ResourceType.LISTS for exposure to MCP clients.export const TOOL_CONFIGS = USE_UNIVERSAL_TOOLS_ONLY ? { // Universal tools for consolidated operations (Issue #352) UNIVERSAL: universalToolConfigs, // Lists are relationship containers - always expose them (Issue #470) [ResourceType.LISTS]: listsToolConfigs, // Workspace members for user discovery (Issue #684) [ResourceType.WORKSPACE_MEMBERS]: workspaceMembersToolConfigs, } : { // Legacy resource-specific tools (deprecated, use DISABLE_UNIVERSAL_TOOLS=true to enable) [ResourceType.COMPANIES]: companyToolConfigs, [ResourceType.PEOPLE]: peopleToolConfigs, [ResourceType.DEALS]: dealToolConfigs, [ResourceType.LISTS]: listsToolConfigs, [ResourceType.TASKS]: tasksToolConfigs, [ResourceType.RECORDS]: recordToolConfigs, [ResourceType.WORKSPACE_MEMBERS]: workspaceMembersToolConfigs, GENERAL: generalToolConfigs, // Add other resource types as needed