Skip to main content
Glama
bit2beat

Bitrix24 MCP server

b24_disk_file_upload

Upload files to a Bitrix24 Disk folder by providing the folder ID, file name, and base64-encoded content.

Instructions

Sube un archivo a una carpeta del Disk de Bitrix24.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
folder_idYesID de la carpeta destino
nameYesNombre del archivo incluyendo extensión
content_base64YesContenido del archivo en Base64
webhook_urlNo

Implementation Reference

  • Handler function that executes the 'b24_disk_file_upload' tool logic. Creates a Bitrix24Client, calls the 'disk.folder.uploadfile' API method with folder_id, name, and base64 file content, and returns the result.
    export async function diskFileUpload({ folder_id, name, content_base64, webhook_url }) {
      const client = new Bitrix24Client(resolveWebhook(webhook_url));
      const res = await client.call('disk.folder.uploadfile', {
        id: folder_id,
        data: { NAME: name },
        fileContent: content_base64,
      });
      return { portal: client.portal, file: res.result, success: true };
    }
  • Zod schema defining input parameters for b24_disk_file_upload: folder_id (string|number), name (string), content_base64 (string), and optional webhook_url.
    export const diskFileUploadSchema = z.object({
      folder_id: z.union([z.string(), z.number()]).describe('ID de la carpeta destino'),
      name: z.string().describe('Nombre del archivo incluyendo extensión'),
      content_base64: z.string().describe('Contenido del archivo en Base64'),
      webhook_url: z.string().url().optional(),
    });
  • index.js:217-219 (registration)
    Registers the 'b24_disk_file_upload' tool on the MCP server with a description, schema validation, and wrapped handler.
    server.tool('b24_disk_file_upload',
      'Sube un archivo a una carpeta del Disk de Bitrix24.',
      diskFileUploadSchema.shape, wrap(diskFileUpload));
  • index.js:44-49 (registration)
    Import statement that brings diskFileUploadSchema and diskFileUpload from src/tools/disk.js into the main index.js registration file.
    import {
      diskStoragesSchema, diskStorages,
      diskFolderListSchema, diskFolderList,
      diskFileGetSchema, diskFileGet,
      diskFileUploadSchema, diskFileUpload,
    } from './src/tools/disk.js';
  • The wrap() helper function used to wrap the diskFileUpload handler, providing error handling and JSON response formatting.
    function wrap(fn) {
      return async (params) => {
        try {
          const result = await fn(params);
          return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
        } catch (err) {
          const msg = err.response?.data
            ? `${err.message}\nBitrix24: ${JSON.stringify(err.response.data)}`
            : err.message;
          return { content: [{ type: 'text', text: `Error: ${msg}` }], isError: true };
        }
      };
    }
Behavior2/5

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

With no annotations, the description should disclose behavioral traits like overwrite behavior, size limits, or required authentication. It only states 'uploads a file' and omits critical details such as the need for a valid webhook_url parameter, leaving the agent unaware of side effects or constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence that efficiently conveys the core action without any superfluous words. The key verb is front-loaded, making it immediately clear.

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 lack of output schema and the presence of a critical parameter (webhook_url) with no explanation, the description is incomplete. It fails to cover return values, error states, authentication requirements, or file size limits, leaving the agent with significant gaps for effective use.

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 75%, so the schema already documents most parameters. The description adds no extra meaning beyond what the schema provides. For the undocumented webhook_url parameter, no clarification is offered, but baseline is adequate.

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 'sube' (upload) and the resource 'archivo' (file) to a 'carpeta' (folder), directly differentiating from sibling tools like b24_disk_file_get (get file) and b24_disk_folder_list (list folders). It is specific and unambiguous.

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, nor any prerequisites (e.g., folder existence, authentication via webhook_url) or exclusions. The description only states the action without context for decision-making.

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