Skip to main content
Glama
bit2beat

Bitrix24 MCP server

b24_tasks_get

Retrieve full task details from Bitrix24 by task ID. Get all task metadata and specified fields.

Instructions

Obtiene el detalle completo de una tarea por ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID de la tarea
selectNoCampos a retornar
webhook_urlNo

Implementation Reference

  • The main handler function for the b24_tasks_get tool. Creates a Bitrix24Client, calls tasks.task.get with the task ID and optional select fields, and returns the task details.
    export async function tasksGet({ id, select, webhook_url }) {
      const client = new Bitrix24Client(resolveWebhook(webhook_url));
      const params = { taskId: id, ...(select ? { select } : {}) };
      const res = await client.call('tasks.task.get', params);
      return { portal: client.portal, task: res.result?.task ?? res.result };
    }
  • Zod schema for b24_tasks_get: validates id (string|number required), select (optional array of strings), and webhook_url (optional URL).
    export const tasksGetSchema = z.object({
      id: z.union([z.string(), z.number()]).describe('ID de la tarea'),
      select: z.array(z.string()).optional().describe('Campos a retornar'),
      webhook_url: z.string().url().optional(),
    });
  • index.js:179-181 (registration)
    Registration of the 'b24_tasks_get' tool on the MCP server with its description, schema, and wrapped handler.
    server.tool('b24_tasks_get',
      'Obtiene el detalle completo de una tarea por ID.',
      tasksGetSchema.shape, wrap(tasksGet));
  • Resolves the webhook URL from the parameter or falls back to environment variable B24_DEFAULT_WEBHOOK.
    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;
    }
  • Bitrix24Client.call() - makes API calls to the Bitrix24 REST API with retry logic for rate limiting and timeouts.
    async call(method, params = {}, retries = 0) {
      return this.limiter.schedule(async () => {
        try {
          const url = `${this.webhookUrl}${method}.json`;
          const response = await axios.post(url, params, { timeout: 30000 });
          if (response.data.error) {
            throw new Error(`Bitrix24 error [${response.data.error}]: ${response.data.error_description}`);
          }
          return response.data;
        } catch (err) {
          if (err.response?.status === 429 && retries < MAX_RETRIES) {
            const retryAfter = parseInt(err.response.headers['retry-after'] || '2', 10);
            await new Promise(r => setTimeout(r, retryAfter * 1000));
            return this.call(method, params, retries + 1);
          }
          if (err.code === 'ECONNABORTED' && retries < MAX_RETRIES) {
            const backoff = Math.pow(2, retries) * 1000;
            await new Promise(r => setTimeout(r, backoff));
            return this.call(method, params, retries + 1);
          }
Behavior2/5

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

With no annotations, the description carries the full burden but only states the basic action. It does not disclose read-only nature, side effects, permissions, or rate limits, leaving significant gaps for safe invocation.

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?

Single sentence, no wasted words, front-loaded with verb and resource. However, could expand slightly on return value or webhook_url 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 no output schema and 3 parameters (one undocumented), the description lacks details on return structure, the purpose of webhook_url, and any prerequisites. Incomplete for safe usage without external knowledge.

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 67% (id and select have descriptions, webhook_url lacks one). The tool description adds no extra meaning beyond the schema; baseline of 3 applies as schema handles most param explanation.

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 'Obtiene' (gets) and the resource 'el detalle completo de una tarea por ID' (full detail of a task by ID), distinguishing it from sibling tools like b24_tasks_list (list), b24_tasks_create (create), etc.

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 vs alternatives, no mention of prerequisites or when not to use it. For example, does not differentiate from b24_tasks_list for obtaining single task details.

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