list_invoices
Referência da tool list_invoices do MCP Server do bitERP (Notas fiscais de saída).
List Invoices · 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.
Lists fiscal invoice records for one organization with optional filters and cursor-based pagination.
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. |
search | string | Não | Optional search on reference code, customer name, notes, or the record code (NTF-1042 for Brazilian companies; prefix depends on the tenant country; older INVO-1042 still matches). |
operation_type | string | Não | Filter by operation type: sale or return. Valores: sale, return. |
product_type | string | Não | Filter by product type: goods, service, or mixed. Valores: goods, service, mixed. |
status | string | Não | Filter by invoice lifecycle status. Valores: draft, finalized, cancelled. |
origin | string | Não | Filter by record provenance: 'internal' for invoices issued by bitERP, 'imported' for invoices brought in from an external NFS-e XML. Unrelated to origin_state_code, which is the geographic origin of the operation. Valores: internal, imported. |
customer_id | string (UUID) | Não | Filter by customer UUID. |
sales_order_id | string (UUID) | Não | Filter by originating sales order UUID. |
include_details | boolean | Não | When true, include items, taxes, customer, and country extension data per row. Defaults to false. |
cursor | string | Não | Opaque cursor for pagination. Omit on first call, then use next_cursor from the previous response. |
limit | integer | Não | Items per page (default: 10, max: 100). |
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 |
|---|---|---|
data | array de objetos | — |
data[].id | string (UUID) | — |
data[].tenant_id | string (UUID) | — |
data[].record_number | integer | Tenant-scoped sequential invoice number shown in the UI as NTF-1042 for Brazilian companies (prefix depends on the tenant country); pass 1042 without the prefix. |
data[].reference_code | string ou null | — |
data[].status | string | — |
data[].operation_type | string | — |
data[].product_type | string | — |
data[].origin | string | Procedência do registro: internal (nasceu no bitERP) ou imported. Valores: internal, imported. |
data[].has_source_xml | boolean | True quando a nota tem arquivo XML de origem preservado no storage (import). |
data[].source_data_import_id | string (UUID) ou null | — |
data[].import_cancellation_source | string ou null | Nota importada cancelada: manual = registrado só no bitERP, não transmitido à prefeitura; demais valores = cancelamento veio no XML importado. Valores: abrasf_nfse_cancelamento, abrasf_nfse_substituicao, nacional_event_101101, nacional_event_105102, nacional_event_105104, nacional_event_305101, spreadsheet, manual. |
data[].import_channel | string ou null | Nota importada: file = XML enviado pelo usuário, spreadsheet = planilha, dfe_adn = captura da NFS-e emitida no Ambiente Nacional. Valores: file, spreadsheet, dfe_adn. |
data[].br_data | object | — |
data[].customer_id | string (UUID) | — |
data[].customer | object ou null | — |
data[].invoice_date | string (date) | — |
data[].origin_state_code | string ou null | — |
data[].origin_country_code | string ou null | — |
data[].destination_state_code | string ou null | — |
data[].destination_country_code | string ou null | — |
data[].customer_tax_type | string ou null | Valores: individual, company. |
data[].salesperson_name | string ou null | — |
data[].fiscal_notes | string ou null | — |
data[].internal_notes | string ou null | — |
data[].discount_amount | string | — |
data[].discount_rate | string | — |
data[].tax_engine_provider | string ou null | — |
data[].sales_order_id | string (UUID) ou null | — |
data[].subtotal | string | — |
data[].items_discount | string | — |
data[].total_discount | string | — |
data[].total_tax | string | — |
data[].withheld_total | string | — |
data[].net_receivable_total | string | — |
data[].total | string | — |
data[].deleted_by_user_id | string (UUID) ou null | — |
data[].created_at | string (date-time) | — |
data[].updated_at | string (date-time) | — |
data[].deleted_at | string (date-time) ou null | — |
has_next_page | boolean | — |
has_previous_page | boolean | — |
next_cursor | string ou null | — |
previous_cursor | string ou null | — |
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": "list_invoices",
"arguments": {
"tenant": "minha-empresa"
}
}
}
