generate_invoices_from_sales_orders
Referência da tool generate_invoices_from_sales_orders do MCP Server do bitERP (Notas fiscais de saída).
Generate Invoices from Sales Orders · Notas fiscais de saída
| Somente leitura | Destrutiva | Idempotente | Mundo aberto |
|---|---|---|---|
| Não | Sim | Sim | Sim |
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.
Creates finalized fiscal invoices in batch from one or more sales orders. When auto_transmit is true or tenant auto_transmit_nfse is enabled, eligible notes are enqueued for background NFS-e transmission.
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_ids | array de string (UUID) | Sim | Sales order UUIDs to generate invoices from (1–50, unique). |
auto_transmit | boolean | Não | When set, overrides tenant auto_transmit_nfse for this batch. true may enqueue external NFS-e transmission. |
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 |
|---|---|---|
results | array de objetos | — |
results[].sales_order_id | string (UUID) | — |
results[].success | boolean | — |
results[].invoice_id | string (UUID) | — |
results[].invoice_reference_code | string ou null | — |
results[].error | string | — |
results[].auto_transmission | object | — |
total | integer | — |
created | integer | — |
failed | integer | — |
_tenant | object | — |
_tenant.id | string (UUID) | — |
_tenant.slug | string | — |
_tenant.company_name | 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": "generate_invoices_from_sales_orders",
"arguments": {
"tenant": "minha-empresa",
"sales_order_ids": [
"<uuid>"
]
}
}
}
