Skip to main content
Glama
bit2beat

Bitrix24 MCP server

b24_products_sections

Retrieves product catalog sections or categories from Bitrix24. Optionally filter by catalog ID using a webhook URL.

Instructions

Lista las secciones/categorías del catálogo de productos.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
catalog_idNoID del catálogo (opcional)
webhook_urlNo

Implementation Reference

  • Main handler for the b24_products_sections tool. Calls catalog.section.list Bitrix24 API with optional catalog_id filter, fetching all pages via pagination helper.
    export async function productsSections({ catalog_id, webhook_url }) {
      const client = new Bitrix24Client(resolveWebhook(webhook_url));
      const params = catalog_id ? { filter: { CATALOG_ID: catalog_id } } : {};
      const sections = await fetchAllPages(client, 'catalog.section.list', params);
      return { portal: client.portal, total: sections.length, sections };
    }
  • Zod schema defining input parameters: optional catalog_id and optional webhook_url.
    export const productsSectionsSchema = z.object({
      catalog_id: z.union([z.string(), z.number()]).optional().describe('ID del catálogo (opcional)'),
      webhook_url: z.string().url().optional(),
    });
  • index.js:279-281 (registration)
    Registration of the tool on the MCP server with name 'b24_products_sections', description, schema, and wrapped handler.
    server.tool('b24_products_sections',
      'Lista las secciones/categorías del catálogo de productos.',
      productsSectionsSchema.shape, wrap(productsSections));
  • Helper used to resolve 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;
    }
  • Helper for paginated API calls, used by the handler to fetch all section pages.
    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;
      }
Behavior2/5

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

No annotations are present, so the description carries full burden. It does not disclose any behavioral traits such as read-only nature, authentication needs, or side effects. Minimal disclosure.

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 description is concise (one sentence) but lacks structure or front-loading of key information. It is not overly verbose, but could be more informative.

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 tool has no output schema and two parameters, yet the description fails to explain the purpose of webhook_url, what sections/categories are returned, or how catalog_id influences results. Several gaps remain.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 50%, with catalog_id described but webhook_url lacking any description. The description does not elaborate on either parameter, adding no meaning 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 lists sections/categories of the product catalog, using a specific verb and resource. It distinguishes from siblings like b24_products_list (lists products) and b24_products_get (gets single product).

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, prerequisites, or when not to use it. The description only states the action without context.

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