Skip to main content
Glama
bit2beat

Bitrix24 MCP server

b24_departments_list

Retrieve a list of departments from your Bitrix24 organizational structure, including hierarchy and responsible managers.

Instructions

Lista departamentos de la estructura organizativa con jerarquía y responsables.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterNoFiltros. Ejemplo: { "PARENT": 5 } para subdepartamentos. { "NAME": "Ventas" } para buscar por nombre
webhook_urlNo

Implementation Reference

  • index.js:200-202 (registration)
    Registration of 'b24_departments_list' tool via server.tool() with departmentsListSchema and departmentsList handler.
    server.tool('b24_departments_list',
      'Lista departamentos de la estructura organizativa con jerarquía y responsables.',
      departmentsListSchema.shape, wrap(departmentsList));
  • Handler function departmentsList that accepts filter and webhook_url, calls department.get via Bitrix24Client with pagination.
    export async function departmentsList({ filter = {}, webhook_url }) {
      const client = new Bitrix24Client(resolveWebhook(webhook_url));
      const departments = await fetchAllPages(client, 'department.get', filter);
      return { portal: client.portal, total: departments.length, departments };
    }
  • Zod schema departmentsListSchema defining input parameters: filter (optional, defaults to {}) and webhook_url (optional URL).
    export const departmentsListSchema = z.object({
      filter: z.record(z.any()).optional().default({}).describe(
        'Filtros. Ejemplo: { "PARENT": 5 } para subdepartamentos. { "NAME": "Ventas" } para buscar por nombre'
      ),
      webhook_url: z.string().url().optional(),
    });
  • Import of resolveWebhook helper used to resolve webhook_url for the Bitrix24 client.
    import { resolveWebhook } from '../utils/resolve-webhook.js';
  • Import of fetchAllPages helper used to paginate through department.get results.
    import { fetchAllPages } from '../utils/pagination.js';
Behavior2/5

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

No annotations are provided, and the description does not disclose behavioral traits such as read-only nature, pagination, error handling, or authentication requirements. The description only states what is listed without safety or side-effect context.

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 description is concise and front-loaded with the core purpose. However, it could be more structured to include brief usage or return info without adding length.

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 (nested object parameter, no output schema, no annotations), the description is minimal. It lacks details on return format, pagination, error handling, or how hierarchy and responsables are represented.

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 coverage is 50%: filter parameter has a description with example, but webhook_url has no description. The tool description adds no extra meaning for webhook_url and does not clarify its purpose or usage, leaving ambiguity.

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 departments with hierarchy and responsible parties, using a specific verb and resource. It distinguishes from sibling tools like b24_groups_list or b24_users_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 on when to use this tool versus alternatives, no exclusion criteria, and no explanation of when to apply the filter parameter for hierarchy or name search.

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