get_contacts
Retrieve a list of contacts from Kommo CRM with pagination support, enabling efficient access and management of CRM data. Supports custom limits up to 250 entries per request.
Instructions
Get list of contacts from Kommo CRM
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of contacts to return (max 250) | |
| page | No | Page number for pagination |
Implementation Reference
- src/http-streamable.ts:708-718 (registration)Registration of the 'get_contacts' tool in the MCP tools/list response, including name, description, and input schema.name: 'get_contacts', description: 'Obter lista de contatos do Kommo CRM', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Número máximo de contatos (padrão: 1000)' }, page: { type: 'number', description: 'Página para paginação (padrão: 1)' } } } }, {
- src/http-streamable.ts:1315-1328 (handler)Handler for the 'get_contacts' tool call, which invokes kommoAPI.getContacts with parameters and returns the JSON response.case 'get_contacts': const contactsLimit = args?.limit || 1000; const contactsPage = args?.page || 1; const contactsData = await kommoAPI.getContacts({ limit: contactsLimit, page: contactsPage }); result = { content: [ { type: 'text', text: JSON.stringify(contactsData, null, 2) } ] }; break;
- src/kommo-api.ts:267-270 (helper)Core helper method in KommoAPI class that makes the API request to fetch contacts from Kommo CRM.async getContacts(params?: any): Promise<{ _embedded: { contacts: KommoContact[] } }> { const response = await this.client.get('/api/v4/contacts', { params }); return response.data; }
- src/kommo-api.ts:26-39 (schema)TypeScript interface defining the structure of KommoContact objects returned by the getContacts method.export interface KommoContact { id: number; name: string; first_name: string; last_name: string; responsible_user_id: number; created_by: number; created_at: number; updated_at: number; custom_fields_values?: any[]; tags?: string[]; leads?: KommoLead[]; companies?: KommoCompany[]; }