Skip to main content
Glama
Miguelgbastos

Kommo CRM MCP Server

get_sales_report

Generate detailed sales reports for a specific date range to analyze performance and track revenue trends within Kommo CRM. Streamline data insights for informed business decisions.

Instructions

Get sales report for a date range

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
date_fromYesStart date (YYYY-MM-DD)
date_toYesEnd date (YYYY-MM-DD)

Implementation Reference

  • Core handler function that executes the sales report logic by querying the Kommo API /leads/reports endpoint.
    async getSalesReport(dateFrom: string, dateTo: string): Promise<KommoSalesReport> {
      const response = await this.client.get('/api/v4/leads/reports', {
        params: {
          date_from: dateFrom,
          date_to: dateTo,
          report_type: 'sales'
        }
      });
      return response.data;
    }
  • TypeScript interface defining the structure of the sales report output.
    export interface KommoSalesReport {
      period: {
        from: string;
        to: string;
      };
      leads: {
        total: number;
        new: number;
        won: number;
        lost: number;
      };
      revenue: {
        total: number;
        average: number;
        conversion_rate: number;
      };
      performance: {
        by_user: Array<{
          user_id: number;
          user_name: string;
          leads_count: number;
          revenue: number;
        }>;
        by_pipeline: Array<{
          pipeline_id: number;
          pipeline_name: string;
          leads_count: number;
          revenue: number;
        }>;
      };
    }
  • MCP tool registration including name, description, and input schema in the tools/list response.
        {
          name: 'get_sales_report',
          description: 'Obter relatório de vendas do Kommo CRM',
      inputSchema: {
        type: 'object',
        properties: {
              limit: { type: 'number', description: 'Número máximo de leads (padrão: 1000)' },
              page: { type: 'number', description: 'Página para paginação (padrão: 1)' }
            }
      }
    },
  • MCP tool call handler that invokes the core getSalesReport method and formats the response.
    case 'get_sales_report':
      const salesLimit = args?.limit || 1000;
      const salesPage = args?.page || 1;
      const dateFrom = args?.dateFrom || '2024-01-01';
      const dateTo = args?.dateTo || '2024-12-31';
      const salesData = await kommoAPI.getSalesReport(dateFrom, dateTo);
    
      result = {
        content: [
          {
            type: 'text',
            text: JSON.stringify(salesData, null, 2)
          }
        ]
      };
      break;
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states the tool retrieves data ('Get'), implying a read operation, but doesn't disclose behavioral traits like authentication needs, rate limits, pagination, error handling, or what the report contains. For a tool with no annotations, this leaves significant gaps in understanding how it behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste—'Get sales report for a date range'—front-loading the core action and scope appropriately. Every word earns its place without redundancy or unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a simple input schema, the description is incomplete. It doesn't explain what the sales report contains, how it's formatted, or any behavioral aspects like data freshness or access permissions. For a report tool in a context with many similar siblings, more detail is needed to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with both parameters clearly documented in the schema (date_from and date_to with format YYYY-MM-DD). The description adds minimal value by mentioning 'date range', which aligns with the schema but doesn't provide additional semantic context beyond what's already structured.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and resource 'sales report' with scope 'for a date range', making the purpose understandable. However, it doesn't differentiate from sibling tools like 'get_lead_conversion_report' or 'get_pipeline_performance_report' that also retrieve reports, leaving some ambiguity about when this specific sales report is appropriate versus other report types.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With multiple sibling report tools (e.g., get_lead_conversion_report, get_pipeline_performance_report), there's no indication of what distinguishes a 'sales report' from these other reports, nor any prerequisites or context for usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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