Skip to main content
Glama
1C OData MCP

1C OData MCP

Изменить строки документа

write.document.update_document_lines
DestructiveIdempotent

Replace an existing 1C document's line items with a new set and recalculate totals; previews by default and writes only after confirmation.

Instructions

Заменяет табличную часть «Товары» существующего документа новым набором строк и пересчитывает сумму. Поддержаны: счёт покупателю, поступление, реализация (и товарами, и услугами), акт об оказании услуг. Строки пишутся в ту табличную часть, которая у документа заполнена («Товары» или «Услуги»). Документ должен быть НЕПРОВЕДЁННЫМ (если проведён — сначала отмените проведение через post_document). По умолчанию dry-run; применение — при confirm=true.

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": {
      "entitySet": "<entitySet>",
      "ref": "<ref>",
      "lines": "<lines>"
    },
    "name": "write.document.update_document_lines"
  }
}

Input Schema

NameRequiredDescriptionDefault
refYesRef_Key документа
linesYesНовый полный набор строк (заменяет прежние — реквизиты старых строк не сохраняются, задавайте content и счета заново)
confirmNofalse (по умолчанию) — только предпросмотр (dry-run), запись НЕ выполняется. true — выполнить создание. Сначала всегда показывайте dry-run и получайте согласие пользователя; при подтверждении передавайте operationId из результата предпросмотра и те же аргументы. После таймаута повторяйте подтверждение с тем же id, не создавая новый предпросмотр.
databaseNoИмя базы 1С из list_databases. Без указания — база по умолчанию; если баз несколько и неясно какая, спросите пользователя.
entitySetYesИмя документа, напр. Document_РеализацияТоваровУслуг

Output Schema

NameRequiredDescriptionDefault
refNo
noteNo
notesNo
dryRunNo
fieldsNo
updatedNo
databaseNo
replayedNo
verifiedNo
entitySetNo
willPatchNo
descriptionNo
operationIdNo
readbackNoteNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

A4.9/5.0
Behavior5/5

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

The annotations already show that this is a destructive, non-read-only write, but the description adds meaning far beyond them: it says that existing line attributes are not preserved and must be re-specified, how the target tabular section is chosen, that the document must be unposted, and that the default is dry-run. It also states the operationId retry rule after a timeout, which is not inferable from the schema or the annotations. The destructive and idempotent behavior is thus disclosed concretely.

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?

Five sentences carry out the structure: what the tool does, which documents it supports, which tabular section receives the lines, the precondition, and the dry-run default. The action and its scope come first, and nothing is repeated that the schema already covers. Every sentence adds constraint or behavior.

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?

For a destructive write with 5 parameters (3 required), the description covers the full call context: supported document types, target tabular section, posting precondition, dry-run and confirm flow with the operationId retry rule. An output schema exists, so return values need no explanation. Nothing an agent needs in order to call the tool 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, but the description adds real meaning about the `lines` parameter: the first line of the description replaces the previous set outright, so fields such as content and accounts must be set again each time. It also explains that lines go into whichever tabular section the document actually has filled ('Товары' or 'Услуги'), which the schema does not say. Further per-parameter detail, such as the dry-run semantics of `confirm`, is in the schema itself.

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 gives a specific verb and resource: it «заменяет табличную часть ... новым набором строк и пересчитывает сумму», and it ties that to exactly which documents it supports. The word «заменяет» (replaces) also separates it from the sibling tools that add or remove a single line (add_document_line, remove_document_line). An agent reading only this sentence can tell what the tool does and what it is not.

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

Usage Guidelines5/5

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

The description says explicitly when the tool must not be used: the document must be NEPROVEDEN (unposted), and if it is posted, the posting must first be cancelled via post_document, naming the sibling tool to use in that case. It also spells out the dry-run-first workflow and the confirm=true condition, so the agent knows what to do next. The only small gap is that it does not explicitly contrast replace-all with add_document_line, but the precondition and workflow guidance are otherwise complete.

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

Deploy Server

Other Tools