Skip to main content
Glama
1C OData MCP

1C OData MCP

Продажи по номенклатуре (УТ 11, КА 2, ERP 2)

read.analytics.get_sales_register
Read-only

Retrieve net sales quantities and revenue for a date range from the 1C sales register, with returns subtracted and optional filters by warehouse, product group, manager, or department.

Instructions

Продажи товаров в штуках за период по регистру «Выручка и себестоимость продаж» (УТ 11, КА 2, ERP 2; проверено на УТ 11.5), включая розницу (в Бухгалтерии продажи по документам — get_sales_breakdown). quantity — нетто: sold (продано) минус returns (возвраты и сторно продаж, в регистре они с минусом); byOperation — то же по хозяйственным операциям (РеализацияВРозницу, РеализацияКлиенту, ВозвратТоваровОтКлиентаПрошлыхПериодов, СторноРеализации…). Розница попадает в регистр только отчётом о розничных продажах после закрытия смены: retailReports.completeThrough — дата, по которую розница видна по всем складам выборки, latest — самый свежий отчёт; какой склад отстаёт — отбор warehouses. Отбор: warehouses — Ref_Key складов (как в get_warehouse_stock), group — группа номенклатуры с подгруппами (Ref_Key, название или путь «Телефоны/Смартфоны/Apple»), groups — несколько групп за один вызов (итоги каждой в byGroup, у позиции matchedGroupRef), query — часть названия или артикул. managers — только продажи этих менеджеров (Ref_Key пользователей 1С, read.catalog.list_users); byManager=true — итоги по менеджерам в byManager; departments и byDepartment — то же по подразделениям. groupBy=warehouse — по складам. excludeOwnOrganizations=true — без продаж своим организациям: в УТ это обычная продажа клиенту, и покупатель узнаётся по ИНН, совпавшему с ИНН организации базы; исключённые штуки и выручка и все контрагенты, признанные своими по ИНН, — в excludedOwnOrganizations (организация без ИНН так не узнаётся, их число там же). cost и margin — себестоимость и валовая прибыль (выручка минус себестоимость), marginExVat — без НДС; у позиции и во всех итогах; до расчёта себестоимости за месяц — предварительная, дату расчёта называет note. revenue и revenueExVat — выручка с НДС и без НДС, нетто (возвраты и сторно вычитаются), в валюте управленческого учёта базы (обычно рубли): розница с комиссионным товаром сверена с отчётами о розничных продажах до рубля. count — всего позиций; длинный список читайте с offset=nextOffset, пока он есть: следующие страницы в течение минуты берут строки первой, регистр заново не читается.

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": {
      "from": "<from>",
      "to": "<to>"
    },
    "name": "read.analytics.get_sales_register"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYesКонец периода (включительно) (YYYY-MM-DD)
fromYesНачало периода (включительно) (YYYY-MM-DD)
groupNoГруппа номенклатуры: Ref_Key, название или путь через «/» («Смартфоны/Apple»). Подгруппы входят
limitNoСколько позиций вернуть
queryNoПоиск товара: части слов из названия или артикул. Можно вместе с group или groups
groupsNoНесколько групп номенклатуры за один вызов (до 50), каждая как group, с подгруппами; вместо group. Позиция входит один раз; у вложенных групп — в самую глубокую. matchedGroupRef у позиции и byGroup с итогами по каждой группе
offsetNoС какой строки начать (0 — с начала); значение из nextOffset прошлого ответа
groupByNoitem — по номенклатуре (по умолчанию); warehouse — номенклатура в разрезе складовitem
databaseNoИмя базы 1С из list_databases. Без указания — база по умолчанию; если баз несколько и неясно какая, спросите пользователя.
managersNoТолько продажи этих менеджеров — Ref_Key пользователей 1С (read.catalog.list_users); менеджер — измерение регистра продаж
snapshotNosnapshot прошлой страницы: если данные изменились, в ответе будет dataChanged
byManagerNoИтоги по менеджерам (byManager) на первой странице: штуки и выручка каждого, без менеджера — отдельно
warehousesNoRef_Key складов (до 100); без параметра — все, включая продажи без склада. Группа складов не принимается
departmentsNoТолько продажи этих подразделений — Ref_Key (их ссылки и названия — в byDepartment)
byDepartmentNoИтоги по подразделениям (byDepartment) на первой странице: штуки и выручка каждого
excludeOwnOrganizationsNoНе считать продажи своим организациям: покупатель-контрагент с ИНН одной из организаций базы. Исключённое — в excludedOwnOrganizations

Output Schema

NameRequiredDescriptionDefault
toYes
costNo
fromYes
noteNo
scanYes
soldYes
countYes
itemsYes
queryNo
marginNo
byGroupNo
groupByNo
returnsYes
revenueYes
databaseYes
snapshotNo
byManagerNo
costExVatNo
itemGroupNo
itemGroupsNo
byOperationNo
byWarehouseNo
dataChangedNo
marginExVatNo
byDepartmentNo
otherSimilarNo
revenueExVatYes
managerFilterNo
retailReportsNo
totalQuantityYes
warehouseFilterNo
departmentFilterNo
excludedOwnOrganizationsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare readOnlyHint/openWorldHint, but the description goes far beyond them: quantity is net of returns and сторно, revenue is in management-accounting currency, cost/margin are preliminary until the month's cost is calculated (with a note field naming the calculation date), retail lag is exposed via retailReports.completeThrough/latest/warehouses, and pagination reuses the first read for a minute via snapshot/nextOffset. Those are exactly the behavioral facts an agent needs and none are recoverable from the annotations or schema.

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

Conciseness3/5

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

Length is defensible for 16 parameters, and the core purpose is front-loaded. But it is delivered as one dense unbroken paragraph mixing filtering, retail-report lag, costing caveats and pagination, with no headings or breaks, which makes it hard to scan and pushes some sentences past their value.

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?

An output schema exists, so return shapes need not be explained, and the description still covers netting, filters, group aggregation, own-organization exclusion, costing preliminaries and pagination. What it omits is sibling positioning against get_sales/get_sales_report, which matters given how many adjacent sales tools exist.

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 still adds real meaning — warehouse Ref_Keys 'как в get_warehouse_stock', group path syntax «Телефоны/Смартфоны/Apple», groups producing byGroup totals and matchedGroupRef (deepest group wins), and the caveat that organizations without an INN cannot be recognized as own and are counted in excludedOwnOrganizations. Some wording duplicates the schema text rather than extending it, which keeps this at 4.

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?

Opens with a specific verb+resource+measure: sales of goods in units for a period from the «Выручка и себестоимость продаж» register, and names the configuration family (УТ 11, КА 2, ERP 2, verified on УТ 11.5). It also names the sibling it is not — in Бухгалтерия, document-based sales are get_sales_breakdown — so an agent can place it against alternatives without opening a schema.

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 a clear routing rule for one case: use this for register-based (УТ/КА/ERP) data, use get_sales_breakdown for Бухгалтерия document data. It also states preconditions that change what you get (retail only appears after shift close via retail reports). It does not differentiate from the other sales siblings (get_sales, get_sales_report) or state a when-not-to-use case, so it stops short of 5.

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