Skip to main content
Glama
bit2beat

Bitrix24 MCP server

b24_crm_timeline_add

Add comments or activities to the timeline of any CRM record, including deals, contacts, companies, and leads, to track updates and interactions.

Instructions

Agrega un comentario o actividad a la línea de tiempo de un registro CRM.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entityYesTipo de entidad CRM: deal, contact, company, lead
entity_idYesID del registro CRM
commentYesTexto del comentario a agregar en la línea de tiempo
webhook_urlNo

Implementation Reference

  • Handler function for b24_crm_timeline_add – calls Bitrix24 REST method crm.timeline.comment.add to add a timeline comment to a CRM entity.
    export async function timelineAdd({ entity, entity_id, comment, webhook_url }) {
      const client = new Bitrix24Client(resolveWebhook(webhook_url));
      const entityMap = { deal: 'CRM_DEAL', contact: 'CRM_CONTACT', company: 'CRM_COMPANY', lead: 'CRM_LEAD' };
      const entityCode = entityMap[entity?.toLowerCase()] ?? entity.toUpperCase();
      const res = await client.call('crm.timeline.comment.add', {
        fields: { ENTITY_ID: entity_id, ENTITY_TYPE: entityCode, COMMENT: comment },
      });
      return { portal: client.portal, entity, entity_id, comment_id: res.result, success: true };
    }
  • Zod schema for timelineAdd input validation: entity, entity_id, comment, and optional webhook_url.
    export const timelineAddSchema = z.object({
      entity: z.string().describe('Tipo de entidad CRM: deal, contact, company, lead'),
      entity_id: z.union([z.string(), z.number()]).describe('ID del registro CRM'),
      comment: z.string().describe('Texto del comentario a agregar en la línea de tiempo'),
      webhook_url: z.string().url().optional(),
    });
  • index.js:133-135 (registration)
    Registers the tool 'b24_crm_timeline_add' with the MCP server, linking schema and handler.
    server.tool('b24_crm_timeline_add',
      'Agrega un comentario o actividad a la línea de tiempo de un registro CRM.',
      timelineAddSchema.shape, wrap(timelineAdd));
  • Helper that resolves the webhook URL from parameter or 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;
    }
  • Wrapper that converts handler return values into MCP content responses with error handling.
    function wrap(fn) {
      return async (params) => {
        try {
          const result = await fn(params);
          return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
        } catch (err) {
          const msg = err.response?.data
            ? `${err.message}\nBitrix24: ${JSON.stringify(err.response.data)}`
            : err.message;
          return { content: [{ type: 'text', text: `Error: ${msg}` }], isError: true };
        }
      };
    }
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It does not mention whether the operation is destructive, idempotent, or requires specific permissions. The description only states the action without elaborating on side effects.

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

Conciseness4/5

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

The description is a single concise sentence that efficiently conveys the core purpose. It is not overly verbose, though slightly more detail could be added without sacrificing conciseness.

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 absence of output schema and the relatively simple parameter set, the description misses essential context such as return values, permissions, or behavior when the timeline entry fails. It feels incomplete for a mutation tool.

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 descriptions cover 3 of 4 parameters with clear meanings. The description adds no extra insight beyond the schema. Although webhook_url lacks a description, the schema provides format hint. Baseline 3 is appropriate.

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's action ('adds a comment or activity') and the resource ('timeline of a CRM record'). It uniquely identifies the tool among siblings as the only timeline-related operation.

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 on when to use this tool versus alternatives, such as other CRM mutation tools (e.g., b24_crm_update) or conditions under which it should be avoided. The description lacks contextual hints.

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