Skip to main content
Glama
bit2beat

Bitrix24 MCP server

b24_disk_file_get

Retrieve file information including download URL from Bitrix24 Disk using the file ID.

Instructions

Obtiene información de un archivo incluyendo URL de descarga.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_idYesID del archivo
webhook_urlNo

Implementation Reference

  • Handler function for b24_disk_file_get. Calls Bitrix24 API 'disk.file.get' with the given file_id and returns file info including download URL.
    export async function diskFileGet({ file_id, webhook_url }) {
      const client = new Bitrix24Client(resolveWebhook(webhook_url));
      const res = await client.call('disk.file.get', { id: file_id });
      return { portal: client.portal, file: res.result };
  • Zod schema for b24_disk_file_get: requires file_id (string or number), optional webhook_url.
    export const diskFileGetSchema = z.object({
      file_id: z.union([z.string(), z.number()]).describe('ID del archivo'),
      webhook_url: z.string().url().optional(),
    });
  • index.js:213-215 (registration)
    Tool registration on the MCP server: name 'b24_disk_file_get', description, schema, and handler via wrap(diskFileGet).
    server.tool('b24_disk_file_get',
      'Obtiene información de un archivo incluyendo URL de descarga.',
      diskFileGetSchema.shape, wrap(diskFileGet));
  • Helper function that resolves the webhook URL from parameter or 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 class used by the handler to make API calls with retry and rate limiting.
    export class Bitrix24Client {
      constructor(webhookUrl) {
        this.webhookUrl = webhookUrl.endsWith('/') ? webhookUrl : webhookUrl + '/';
        this.limiter = new RateLimiter(500);
        this.portal = this._extractPortal(webhookUrl);
      }
    
      _extractPortal(url) {
        try {
          return new URL(url).hostname;
        } catch {
          return 'unknown';
        }
      }
    
      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 must disclose behavior. It states 'gets information' implying read-only but does not mention permissions, side effects, rate limits, or what information is returned beyond the URL. The webhook_url parameter's effect is unexplained.

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. However, it could be restructured to list key information points.

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?

No output schema is present, and the description does not specify what fields the returned info contains. This leaves the agent uncertain about the response structure.

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%: file_id has a description, but webhook_url lacks one. The description adds no meaning beyond the schema, leaving the purpose of webhook_url unclear.

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 that the tool retrieves file information including download URL, specifying the verb 'gets information' and the resource 'file'. This distinguishes it from sibling tools like upload, folder list, and storages.

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 given on when to use this tool over siblings, prerequisites, or context. The description does not explain when the optional webhook_url parameter should be used.

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