prefill_invoice_from_sales_order
Referência da tool prefill_invoice_from_sales_order do MCP Server do bitERP (Notas fiscais de saída).
Prefill Invoice from Sales Order · Notas fiscais de saída
| Somente leitura | Destrutiva | Idempotente | Mundo aberto |
|---|---|---|---|
| Sim | Não | Sim | Não |
Descrição
A descrição abaixo é a que o servidor publica, em inglês, e é o texto que o agente lê para decidir quando usar a tool.
Returns a draft invoice payload prefilled from a sales order (commercial data only; taxes are not computed).
Parâmetros
| Parâmetro | Tipo | Obrigatório | Descrição |
|---|---|---|---|
tenant | string | Sim | Defines which tenant will have data read or changed. Use list_tenants first and prefer the returned tenant slug. Writes are permanent, so when the user has more than one tenant you must confirm the tenant before any write and never assume or reuse a previous choice without confirmation. UUID is accepted only when already known safely. |
sales_order_id | string (UUID) | Sim | UUID of the sales order to prefill from. |
Resposta
O structuredContent da resposta traz os campos abaixo (até dois níveis; o schema completo está no outputSchema publicado no tools/list).
| Campo | Tipo | Descrição |
|---|---|---|
operation_type | string | Valores: sale, return. |
customer_id | string (UUID) | — |
product_type | string | — |
sales_order_id | string (UUID) | — |
discount_amount | string | — |
discount_rate | string | — |
items | array de objetos | — |
items[].item_description | string | — |
items[].quantity | string | — |
items[].unit_price | string | — |
items[].discount_amount | string | — |
items[].product_id | string (UUID) ou null | — |
items[].sales_order_item_id | string (UUID) ou null | — |
br_data | object | — |
br_data.taxation_type | string | — |
Exemplo de chamada
Requisição tools/call com os parâmetros obrigatórios. Os valores são ilustrativos: troque minha-empresa pelo tenant devolvido por list_tenants e cada <...> por um valor real.
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "prefill_invoice_from_sales_order",
"arguments": {
"tenant": "minha-empresa",
"sales_order_id": "<uuid>"
}
}
}
