Skip to main content
Glama
bit2beat

Bitrix24 MCP server

b24_read_pipelines

Retrieve CRM pipelines and their stages, including colors, semantics, and ordering. Use entity type ID to filter results.

Instructions

Lee pipelines (funnels) y sus etapas con colores, semántica y orden.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
webhook_urlNoURL del webhook (opcional si está configurado por defecto)
entity_type_idNoID del tipo de entidad (opcional, default: todos)

Implementation Reference

  • The main handler function for the 'b24_read_pipelines' tool. It instantiates a Bitrix24Client and Bitrix24Reader, calls reader.readPipelines(entity_type_id), and returns a result with the portal URL, pipelines data, and a summary string.
    export async function readPipelines({ webhook_url, entity_type_id }) {
      const client = new Bitrix24Client(resolveWebhook(webhook_url));
      const reader = new Bitrix24Reader(client);
      const pipelines = await reader.readPipelines(entity_type_id);
    
      const count = Object.keys(pipelines).length;
      const stageCount = Object.values(pipelines).reduce((acc, p) => acc + (p.stages?.length ?? 0), 0);
    
      return {
        portal: client.portal,
        pipelines,
        summary: `${count} pipelines con ${stageCount} etapas en total`,
      };
    }
  • Zod schema defining the input parameters: webhook_url (optional URL string) and entity_type_id (optional integer for filtering by entity type).
    export const readPipelinesSchema = z.object({
      webhook_url: z.string().url().optional().describe('URL del webhook (opcional si está configurado por defecto)'),
      entity_type_id: z.number().int().optional().describe('ID del tipo de entidad (opcional, default: todos)'),
    });
  • index.js:146-148 (registration)
    Registration of the 'b24_read_pipelines' tool with the MCP server, binding its schema and handler.
    server.tool('b24_read_pipelines',
      'Lee pipelines (funnels) y sus etapas con colores, semántica y orden.',
      readPipelinesSchema.shape, wrap(readPipelines));
  • The reader.readPipelines() method that performs the actual Bitrix24 API calls. Fetches categories (pipelines) using crm.category.list or crm.lead.status.list for leads, then fetches stages per category using crm.stage.list. Returns a dictionary keyed by 'entityTypeId_categoryId'.
    async readPipelines(entityTypeId = null) {
      const pipelines = {};
    
      const entityTypes = entityTypeId
        ? [{ ENTITY_TYPE_ID: entityTypeId }]
        : [{ ENTITY_TYPE_ID: 2 }, { ENTITY_TYPE_ID: 1 }];
    
      for (const et of entityTypes) {
        const id = et.ENTITY_TYPE_ID;
        try {
          let categories;
          if (id === 2) {
            categories = await fetchAllPages(this.client, 'crm.category.list', { entityTypeId: id });
          } else if (id === 1) {
            const res = await this.client.call('crm.lead.status.list');
            categories = [{ ID: 'lead', NAME: 'Lead Pipeline', stages: res.result }];
          } else {
            categories = await fetchAllPages(this.client, 'crm.category.list', { entityTypeId: id });
          }
    
          for (const cat of categories) {
            const stages = await fetchAllPages(this.client, 'crm.stage.list', {
              entityTypeId: id,
              categoryId: cat.ID,
            });
            pipelines[`${id}_${cat.ID}`] = { ...cat, stages };
          }
        } catch {
          // Entity type may not support pipelines
        }
      }
    
      return pipelines;
    }
Behavior3/5

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

With no annotations, the description carries the full burden. It indicates a read operation ('Lee'), which is non-destructive, but does not disclose behaviors like required permissions, rate limits, or side effects. The description is adequate but not explicit.

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 sentence that is front-loaded with the key action and resource, and it includes relevant details (colors, semantics, order) without any unnecessary words. Every word earns its place.

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

Completeness4/5

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

Given the simplicity of the tool (optional parameters, no output schema), the description sufficiently conveys the tool's purpose and what data is returned (stages with colors, semantics, order). It lacks an explicit statement about the output format, but the context is adequate.

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?

The input schema has 100% coverage with descriptions for both parameters. The tool description does not add any additional semantic information beyond what the schema provides, meeting the baseline score of 3.

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

Purpose5/5

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

The description clearly states the verb 'Lee' (read) and the resource 'pipelines (funnels) y sus etapas', including additional details like colors, semantics, and order. This distinguishes it from sibling read tools like b24_read_automations or b24_read_custom_fields.

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

Usage Guidelines4/5

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

The description provides clear context that this tool is for reading pipeline and stage data, implying its use case. However, it does not explicitly state when to use it versus alternatives or mention any exclusions, so it falls short of a 5.

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

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/bit2beat/bitrix24-mcp'

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