Skip to main content
Glama
mcp-1c-local-bridge

mcp-1c-local-bridge

by ntappw

save_file

Evaluates a 1C server expression and writes the result — PDF, spreadsheet, binary data, or text — to a file on the user's computer, rolling back any database changes.

Instructions

Вычисляет выражение на сервере 1С и записывает значение в файл на компьютере пользователя: печатную форму в PDF, двоичные данные расширения или присоединённого файла, текст. Выражение вычисляется в транзакции с откатом, как eval: документ можно провести или изменить ради печати - в базе это не сохранится. Нужно разрешение «Код на клиенте» на форме: файл пишет клиент 1С. Существующий файл перезаписывается.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "expression": "<expression>"
    },
    "name": "save_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoКуда записать файл на компьютере пользователя: путь Windows или путь WSL. Пусто - во временную папку сеанса моста (удаляется при закрытии формы обработки).
formatNoФормат табличного документа: pdf, mxl, xlsx, xls, docx, ods, html, txt. Пусто - по расширению path, без path - pdf.
sessionNoСеанс моста: идентификатор из sessions или часть строки соединения, имени конфигурации, пользователя. Не указан - единственный открытый сеанс.
timeoutNoСколько секунд ждать ответ. Команда, которую обработка не начала за это время, снимается; начатая выполняется дальше, её результат забирается инструментом result.
expressionYesВыражение 1С на сервере: двоичные данные, табличный или текстовый документ, картинка, строка, хранилище значения либо адрес временного хранилища с таким значением.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.6.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so: it discloses that evaluation runs in a rolled-back transaction so posted/modified documents are NOT persisted, that an existing target file is overwritten, that the write is performed by the 1C client and therefore needs the "Код на клиенте" permission, and that an empty path lands in a session temp folder purged when the form closes. These are exactly the side-effect and auth facts an agent needs before calling a write-capable tool.

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?

Front-loaded with the purpose, followed by side-effect semantics, the permission prerequisite, and the overwrite caveat — all load-bearing. The trailing clause "файл пишет клиент 1С" partially restates the preceding permission sentence, a minor redundancy in an otherwise tight four-sentence block.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need no explanation, and the description covers the remaining risk surface: rollback semantics, overwrite of an existing file, required permission, and default temp destination. For a five-parameter write tool with no annotations, nothing an agent needs to call it safely is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description goes slightly beyond the schema by stating the overwrite behavior of the destination file, which the path parameter description does not mention. It adds no detail on format resolution or session/timeout beyond what the schema already documents.

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?

States a specific compound action (evaluate an expression on the 1C server AND write the value to a file on the user's computer) and enumerates the value kinds handled (PDF print form, binary data, text). It also explicitly anchors itself against the sibling eval ("как eval"), making the difference between evaluating-and-returning versus evaluating-and-saving obvious.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The comparison with eval makes the selection context clear: the same expression semantics apply, but here the output lands in a file. It also gives a prerequisite ("

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.