Skip to main content
Glama
1C OData MCP

1C OData MCP

Создать счёт покупателю

write.sales.create_invoice

Creates a draft buyer invoice in 1C with goods or service line items, previewing the result by default and writing only after confirmation.

Instructions

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

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": {
      "counterpartyRef": "<counterpartyRef>",
      "lines": "<lines>"
    },
    "name": "write.sales.create_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
dateNoДата документа YYYY-MM-DD (по умолчанию — момент предпросмотра)
linesYesПозиции счёта
commentNoУправление торговлей: комментарий
confirmNofalse (по умолчанию) — только предпросмотр (dry-run), запись НЕ выполняется. true — выполнить создание. Сначала всегда показывайте dry-run и получайте согласие пользователя; при подтверждении передавайте operationId из результата предпросмотра и те же аргументы. После таймаута повторяйте подтверждение с тем же id, не создавая новый предпросмотр.
basisRefNoУправление торговлей: документ-основание — реализация (возврат клиента, счёт) или приобретение (возврат поставщику)
databaseNoИмя базы 1С из list_databases. Без указания — база по умолчанию; если баз несколько и неясно какая, спросите пользователя.
contractRefNoRef_Key договора (необязательно)
operationIdNoUUID из предпросмотра. Передайте его при confirm=true, чтобы повтор не создал дубликат.
vatTaxationNoУправление торговлей: налогообложение НДС (ПродажаОблагаетсяНДС, ПродажаНеОблагаетсяНДС, …); по умолчанию — как в последнем документе организации
agreementRefNoУправление торговлей: Ref_Key соглашения с клиентом или поставщиком (одно у партнёра — само)
organizationNoОрганизация (юрлицо) для фильтра: часть названия, ИНН или Ref_Key из list_organizations. Без указания — все организации базы.
orgBankAccountNoБанковский счёт организации — печатается в документе как реквизиты для оплаты. Название/номер счёта (напр. «Сбербанк» или «40802…») либо Ref_Key. Без указания берётся ОСНОВНОЙ счёт организации.
paymentDueDateNoУправление торговлей: дата оплаты YYYY-MM-DD (по умолчанию — дата документа)
responsibleRefNoОтветственный документа — Ref_Key пользователя 1С (read.catalog.list_users): ставится в «Ответственный» или, где его нет (продажи и закупки УТ), в «Менеджер». Помеченный, недействительный и служебный — отказ; у документов без обоих полей (ПКО, РКО и заявка на расходование УТ) — отказ. Заменяет ответственного из fields
sumIncludesVatNoСумма включает НДС
counterpartyRefYesRef_Key контрагента-покупателя

Output Schema

NameRequiredDescriptionDefault
refNo
codeNo
noteNo
notesNo
dryRunNo
createdNo
payloadNo
retriedNo
warningNo
databaseNo
replayedNo
entitySetNo
reconciledNo
willCreateNo
descriptionNo
operationIdNo
deletionMarkNo
writableBaseNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

A4.5/5.0
Behavior5/5

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

Adds substantial behavior beyond the annotations: the document is never posted automatically, dry-run writes nothing, the operationId from the preview must be echoed on confirm to avoid duplicates, and the same id must be reused after a timeout rather than re-previewing. It also discloses that 1C does not fill the 'Содержание' field itself and that the org bank account defaults to the main account.

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?

Three front-loaded sentences lead with what is created and its draft state, then the confirm/dry-run contract. The service-line note earns its place; a small amount of Ref_Key phrasing restates the schema.

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

Completeness4/5

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

For a 16-parameter write tool with annotations and an output schema, the description covers the critical risks: draft vs posted, idempotent confirmation, and the printing field for services. Minor gaps remain, such as how to resolve a counterparty Ref_Key, which the schema only hints at via list_users.

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 genuinely adds practical meaning: content must be supplied for service lines because it is what prints on the invoice, and counterparty/contract/lines are addressed by Ref_Key. Much of the remaining parameter detail (defaults, Ref_Key semantics) is already in the schema, which caps it below 5.

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+resource: creates a buyer invoice document with a 'Товары' tabular section, and immediately clarifies that it lands as an unposted draft. That draft-state detail separates it from posting tools and from sibling invoice creators in the catalog.

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 clear when-to guidance for the two modes: dry-run by default, real creation only with confirm=true, and posting routed to 1C manually or via post_document. It does not explicitly say when to choose this over siblings such as write.sales.create_issued_invoice, so it stops short of full alternative routing.

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