Skip to main content
Glama

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
NameRequiredDescriptionDefault
limitNoNumber of companies to return (max 250)
pageNoPage number for pagination

Implementation Reference

  • 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)' } } } },
  • 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)' } } } },
  • 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;
  • 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; }
  • 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[]; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Miguelgbastos/Kommo-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server