Skip to main content
Glama
bit2beat

Bitrix24 MCP server

b24_users_list

Retrieve active Bitrix24 users with name, email, position, department, and online status. Apply filters to narrow results by department or name.

Instructions

Lista usuarios activos con nombre, email, cargo, departamento y estado online.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterNoFiltros. Default: { ACTIVE: true }. Otros: { "UF_DEPARTMENT": 5, "NAME": "Brian" }
selectNoCampos a retornar. Default: ID, NAME, LAST_NAME, EMAIL, WORK_POSITION, UF_DEPARTMENT, IS_ONLINE
all_pagesNo
webhook_urlNo

Implementation Reference

  • The main handler function for b24_users_list. Calls Bitrix24 API 'user.get' with optional filters, selects, and pagination. Returns portal name, total count, and user list.
    export async function usersList({ filter = { ACTIVE: true }, select, all_pages = true, webhook_url }) {
      const client = new Bitrix24Client(resolveWebhook(webhook_url));
      const params = {
        filter,
        select: select ?? ['ID', 'NAME', 'LAST_NAME', 'EMAIL', 'WORK_POSITION', 'UF_DEPARTMENT', 'IS_ONLINE', 'LAST_ACTIVITY_DATE'],
      };
      const users = all_pages
        ? await fetchAllPages(client, 'user.get', params)
        : (await client.call('user.get', params)).result ?? [];
      return { portal: client.portal, total: users.length, users };
    }
  • Zod schema for b24_users_list input. Defines optional parameters: filter (defaults to {ACTIVE: true}), select (fields to return), all_pages (pagination flag), and webhook_url.
    export const usersListSchema = z.object({
      filter: z.record(z.any()).optional().default({ ACTIVE: true }).describe(
        'Filtros. Default: { ACTIVE: true }. Otros: { "UF_DEPARTMENT": 5, "NAME": "Brian" }'
      ),
      select: z.array(z.string()).optional().describe(
        'Campos a retornar. Default: ID, NAME, LAST_NAME, EMAIL, WORK_POSITION, UF_DEPARTMENT, IS_ONLINE'
      ),
      all_pages: z.boolean().optional().default(true),
      webhook_url: z.string().url().optional(),
    });
  • index.js:196-198 (registration)
    Registration of the 'b24_users_list' tool on the MCP server with its schema and wrapped handler.
    server.tool('b24_users_list',
      'Lista usuarios activos con nombre, email, cargo, departamento y estado online.',
      usersListSchema.shape, wrap(usersList));
  • Helper utility 'fetchAllPages' used by the handler to fetch all pages of results from the Bitrix24 API.
    export async function fetchAllPages(client, method, params = {}) {
      const results = [];
      let start = 0;
    
      while (true) {
        const response = await client.call(method, { ...params, start });
        const items = response.result;
    
        if (!items || (Array.isArray(items) && items.length === 0)) break;
    
        if (Array.isArray(items)) {
          results.push(...items);
        } else {
          results.push(items);
        }
    
        const total = response.total ?? 0;
        start += 50;
        if (start >= total || items.length < 50) break;
      }
    
      return results;
    }
  • Helper utility 'resolveWebhook' that resolves the webhook URL from the 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;
    }
Behavior2/5

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

No annotations are present, so the description must disclose behavior. It does not mention that the default filter includes only active users, that pagination is handled via all_pages, or that webhook_url can be used. The behavior of the 'select' parameter is also not described.

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 tool's purpose. While structured additional details would be helpful, the brevity is not detrimental given the tool's simplicity.

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?

The description lacks important context: it does not explain the return format, pagination behavior, or how to apply custom filters beyond the default. Given that the tool has 4 parameters and no output schema, the description is insufficient for complete agent understanding.

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?

The schema covers 50% of parameters with descriptions (filter and select). The description adds no information about any parameters. For parameters like all_pages and webhook_url, no meaning is provided beyond the schema definition. The description could have compensated but does not.

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 it lists active users with specific fields (name, email, position, department, online status). The verb 'lista' and resource 'usuarios activos' are precise and distinguish from sibling tools like b24_departments_list or b24_groups_list.

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 vs. alternatives such as b24_departments_list or b24_groups_list. The description only says what it does, not when or when not to use it.

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