get_companies
Retrieve a paginated list of companies from Kommo CRM, specifying the number of results per page and the page number for efficient data management.
Instructions
Get list of companies from Kommo CRM
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of companies to return (max 250) | |
| page | No | Page number for pagination |
Implementation Reference
- src/http-streamable.ts:719-728 (registration)Registration of the get_companies tool in the MCP tools/list response, including input schema
name: 'get_companies', description: 'Obter lista de empresas do Kommo CRM', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Número máximo de empresas (padrão: 1000)' }, page: { type: 'number', description: 'Página para paginação (padrão: 1)' } } } }, - src/http-streamable.ts:721-728 (schema)Input schema definition for get_companies tool
inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Número máximo de empresas (padrão: 1000)' }, page: { type: 'number', description: 'Página para paginação (padrão: 1)' } } } }, - src/http-streamable.ts:1330-1343 (handler)Handler implementation for get_companies: calls KommoAPI.getCompanies and returns JSON stringified data
case 'get_companies': const companiesLimit = args?.limit || 1000; const companiesPage = args?.page || 1; const companiesData = await kommoAPI.getCompanies({ limit: companiesLimit, page: companiesPage }); result = { content: [ { type: 'text', text: JSON.stringify(companiesData, null, 2) } ] }; break; - src/kommo-api.ts:288-291 (helper)KommoAPI.getCompanies method: API client call to fetch companies from Kommo CRM
async getCompanies(params?: any): Promise<{ _embedded: { companies: KommoCompany[] } }> { const response = await this.client.get('/api/v4/companies', { params }); return response.data; } - src/kommo-api.ts:41-52 (schema)Type definition for KommoCompany, used in the return type of getCompanies
export interface KommoCompany { id: number; name: string; responsible_user_id: number; created_by: number; created_at: number; updated_at: number; custom_fields_values?: any[]; tags?: string[]; leads?: KommoLead[]; contacts?: KommoContact[]; }