Skip to main content
Glama
bit2beat

Bitrix24 MCP server

b24_crm_fields

Retrieve all standard and custom CRM fields with types, labels, and configuration for any entity: deal, contact, company, or lead.

Instructions

Lista todos los campos disponibles de una entidad CRM (estándar + personalizados) con sus tipos, etiquetas y configuración.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entityNoTipo de entidad: deal, contact, company, lead
entity_type_idNoID de SPA
webhook_urlNo

Implementation Reference

  • Handler function that calls the Bitrix24 CRM .fields API method to list all available fields for a given entity (deal, contact, company, lead) or a Smart Process by entity_type_id. Returns each field's code and definition.
    export async function crmFields({ entity, entity_type_id, webhook_url }) {
      const client = new Bitrix24Client(resolveWebhook(webhook_url));
      const { base, extra } = resolveMethod(entity, entity_type_id);
      const res = await client.call(`${base}.fields`, extra);
      const fields = res.result?.fields ?? res.result ?? {};
      const fieldList = Object.entries(fields).map(([code, def]) => ({ code, ...def }));
      return {
        entity: entity || `SPA_${entity_type_id}`,
        portal: client.portal,
        total_fields: fieldList.length,
        fields: fieldList,
      };
    }
  • Zod schema defining the input parameters: entity (optional string), entity_type_id (optional int), and webhook_url (optional URL).
    export const crmFieldsSchema = z.object({
      entity: z.string().optional().describe('Tipo de entidad: deal, contact, company, lead'),
      entity_type_id: z.number().int().optional().describe('ID de SPA'),
      webhook_url: z.string().url().optional(),
    });
  • index.js:129-131 (registration)
    Registration of the 'b24_crm_fields' tool on the MCP server with its description, schema, and handler.
    server.tool('b24_crm_fields',
      'Lista todos los campos disponibles de una entidad CRM (estándar + personalizados) con sus tipos, etiquetas y configuración.',
      crmFieldsSchema.shape, wrap(crmFields));
  • Helper function resolveMethod() maps entity names to Bitrix24 REST API method prefixes (e.g., deal -> crm.deal) and handles Smart Processes via crm.item.
    function resolveMethod(entity, entityTypeId) {
      if (entityTypeId) return { base: 'crm.item', extra: { entityTypeId } };
      const base = ENTITY_METHOD[entity?.toLowerCase()];
      if (!base) throw new Error(`Entidad desconocida: "${entity}". Usá deal, contact, company, lead, quote, invoice, o pasá entityTypeId para SPA.`);
      return { base, extra: {} };
    }
  • ENTITY_METHOD mapping object that translates entity names to Bitrix24 REST API base method names.
    const ENTITY_METHOD = {
      deal:     'crm.deal',
      contact:  'crm.contact',
      company:  'crm.company',
      lead:     'crm.lead',
      quote:    'crm.quote',
      invoice:  'crm.invoice',
      order:    'sale.order',
      // SPA / Smart Process usa crm.item con entityTypeId
    };
Behavior3/5

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

With no annotations, the description carries the burden. It correctly implies a read-only operation but does not explicitly state safety, required permissions, or side effects. It is adequate but lacks detail.

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?

Single sentence that is front-loaded with the action and key details. No unnecessary words.

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

Completeness3/5

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

The description mentions the output includes types, labels, and configuration, but lacks details on pagination, limits, error handling, or the role of optional parameters. Adequate for a simple listing but not comprehensive.

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

Parameters2/5

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

Schema description coverage is 67% (2 of 3 parameters have descriptions). The tool description does not add meaning beyond the schema for 'entity' and 'entity_type_id', and does not address the undocumented 'webhook_url' parameter at all.

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?

Description clearly states the tool lists all available fields for a CRM entity, including standard and custom, with types, labels, and configuration. It distinguishes from siblings like b24_crm_list (which lists entities) and b24_read_custom_fields (which may have different scope).

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?

No guidance is provided on when to use this tool versus alternatives like b24_read_custom_fields or b24_crm_list. There is no mention of prerequisites, context, or exclusions.

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