Skip to main content
Glama
bit2beat

Bitrix24 MCP server

b24_crm_create

Create CRM records such as deals, contacts, companies, leads, quotes, or SPA items using specified fields and optional parameters.

Instructions

Crea un nuevo registro CRM: deal, contact, company, lead, cotización, o item de SPA.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entityNo
entity_type_idNo
fieldsYesCampos del registro a crear. Ejemplo: { "TITLE": "Nuevo deal", "STAGE_ID": "NEW", "ASSIGNED_BY_ID": 1 }
paramsNoParámetros adicionales del método (ej: REGISTER_SONET_EVENT)
webhook_urlNo

Implementation Reference

  • index.js:117-119 (registration)
    Registration of the 'b24_crm_create' tool with the MCP server, binding schema (crmCreateSchema) and handler (crmCreate) via wrap().
    server.tool('b24_crm_create',
      'Crea un nuevo registro CRM: deal, contact, company, lead, cotización, o item de SPA.',
      crmCreateSchema.shape, wrap(crmCreate));
  • Zod schema for input validation: optional entity string, optional entity_type_id int, required fields record, optional params record, optional webhook_url.
    export const crmCreateSchema = z.object({
      entity: z.string().optional(),
      entity_type_id: z.number().int().optional(),
      fields: z.record(z.any()).describe('Campos del registro a crear. Ejemplo: { "TITLE": "Nuevo deal", "STAGE_ID": "NEW", "ASSIGNED_BY_ID": 1 }'),
      params: z.record(z.any()).optional().describe('Parámetros adicionales del método (ej: REGISTER_SONET_EVENT)'),
      webhook_url: z.string().url().optional(),
    });
  • The main handler function. Resolves the webhook, determines the CRM method base, calls the Bitrix24 REST API '{base}.add' with fields, and returns the created record ID.
    export async function crmCreate({ entity, entity_type_id, fields, params = {}, webhook_url }) {
      const client = new Bitrix24Client(resolveWebhook(webhook_url));
      const { base, extra } = resolveMethod(entity, entity_type_id);
      const res = await client.call(`${base}.add`, { fields: { ...fields, ...extra }, params });
      const id = res.result?.item?.id ?? res.result;
      return { entity: entity || `SPA_${entity_type_id}`, portal: client.portal, created_id: id };
    }
  • Helper function 'resolveMethod' that maps entity names to REST method bases (e.g., 'crm.deal') or uses 'crm.item' for SPA entities via entityTypeId.
    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: {} };
    }
  • Resolves the webhook URL from the provided parameter or falls back to the B24_DEFAULT_WEBHOOK environment variable.
    export function resolveWebhook(webhookParam) {
      const url = webhookParam || process.env.B24_DEFAULT_WEBHOOK;
      if (!url) {
        throw new Error(
          'No se especificó webhook_url y no hay B24_DEFAULT_WEBHOOK configurado. ' +
          'Indicá el webhook en el parámetro webhook_url o configuralo en el servidor MCP.'
        );
      }
      return url;
    }
Behavior2/5

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

With no annotations, the description must disclose behavioral traits, but it only states 'creates a new record' without mentioning permissions, side effects, rate limits, or what happens on failure. The mutation nature is implied but not elaborated.

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

Conciseness3/5

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

The single-sentence description is concise but lacks structure. It front-loads the purpose but omits important details, making it minimally adequate.

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 the complexity (5 parameters, nested objects, no output schema, low coverage), the description is insufficient. It fails to explain parameter relationships, usage of 'entity_type_id', or behavior of 'params' and 'webhook_url'.

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 coverage is 40% (only 'fields' and 'params' have descriptions). The description lists entity types but does not explain how to use the 'entity' or 'entity_type_id' parameters. It adds marginal value beyond the schema.

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 tool creates a new CRM record and lists six specific types (deal, contact, company, lead, quote, SPA item), distinguishing it from siblings like b24_crm_update or b24_crm_delete.

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 (e.g., b24_crm_update for updates, b24_crm_get for retrieval). There are no exclusions or prerequisites mentioned.

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