Skip to main content
Glama
1c-odata-mcp

1c-odata-mcp

by foxnaim

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

write.document.update_document_lines

Replaces an existing 1C document's item/service lines with a new set and recalculates totals; supports invoices, receipts, sales, and service acts. Requires an unposted document; defaults to dry-run.

Instructions

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

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 observedv0.12.0

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the annotations: discloses that the previous lines are wholly replaced, that lines are written to whichever tabular section is populated («Товары» or «Услуги»), that the total is recalculated, that 1С does not auto-fill «Содержание», and that dry-run is the default with an operationId that must be reused on retry after a timeout. The loss of old line requisites is disclosed even though destructiveHint=false, so the agent is warned where the annotation is silent.

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 short sentences, front-loaded with the verb and the effect, then supported document types, then targeting rule, then prerequisite, then the dry-run/confirm protocol. No filler; the slight tension between the opening «Товары» and the later «Товары» или «Услуги» is resolved within the same paragraph.

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 multi-parameter mutating tool this covers everything an agent needs to call it safely: supported entity sets, the unposted precondition, section targeting, full-replacement warning, and the preview/confirm handshake. Return values are covered by the output schema, so the description need not restate them.

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% and the schema already documents every field in depth, so the baseline is 3. The description still adds meaning the schema does not: that the entire tabular section is replaced rather than merged, and which section the `lines` array lands in — a routing detail not derivable from the parameter definitions.

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 verb and resource ("Заменяет табличную часть ... новым набором строк и пересчитывает сумму") plus the exact document types it covers (счёт покупателю, поступление, реализация, акт об оказании услуг). The replacement semantics ("новый полный набор строк") clearly separate it from the sibling add_document_line / remove_document_line tools without needing to name them.

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?

Gives an explicit prerequisite (document must be НЕПРОВЕДЁННЫЙ) and routes the agent to post_document to unpost first, plus the dry-run/confirm=true workflow. It stops short of explicitly contrasting with add_document_line for the case where only one line should change, leaving that choice inferential.

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