biterp

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 leituraDestrutivaIdempotenteMundo aberto
NãoSimSimSim

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âmetroTipoObrigatórioDescrição
tenantstringSimDefines 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_idsarray de string (UUID)SimSales order UUIDs to generate invoices from (1–50, unique).
auto_transmitbooleanNãoWhen 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).

CampoTipoDescrição
resultsarray de objetos—
results[].sales_order_idstring (UUID)—
results[].successboolean—
results[].invoice_idstring (UUID)—
results[].invoice_reference_codestring ou null—
results[].errorstring—
results[].auto_transmissionobject—
totalinteger—
createdinteger—
failedinteger—
_tenantobject—
_tenant.idstring (UUID)—
_tenant.slugstring—
_tenant.company_namestring—

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>"
            ]
        }
    }
}

Nesta página