get_sales_order
Referência da tool get_sales_order do MCP Server do bitERP (Pedidos de venda).
Get Sales Order · Pedidos de venda
| 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 one sales order record by UUID or record number with customer and line-item details. Provide exactly one of id or record_number.
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. |
id | string (UUID) | Não | The UUID of the sales order to retrieve |
record_number | integer | Não | The tenant-scoped sales order record number to retrieve |
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 |
|---|---|---|
id | string (UUID) | — |
tenant_id | string (UUID) | — |
record_number | integer | — |
customer_id | string (UUID) | — |
quote_id | string (UUID) ou null | — |
subscription_id | string (UUID) ou null | — |
quote | object ou null | — |
quote.id | string (UUID) | — |
quote.reference_code | string ou null | — |
reference_code | string ou null | — |
operation_type | string | — |
product_type | string | Valores: goods, service, mixed. |
status | string | Valores: draft, confirmed, cancelled. |
order_date | string (date) | — |
delivery_date | string (date) ou null | — |
salesperson_name | string ou null | — |
description | string ou null | — |
notes | string ou null | — |
subtotal | string | — |
items_discount | string | — |
discount_amount | string | — |
discount_rate | string | — |
total_discount | string | — |
total | string | — |
metadata | object | — |
pending_receivables | array de objetos ou null | — |
br_data | object ou null | — |
br_data.taxation_type | string ou null | — |
created_by_user_id | string (UUID) ou null | — |
updated_by_user_id | string (UUID) ou null | — |
deleted_by_user_id | string (UUID) ou null | — |
created_at | string (date-time) | — |
updated_at | string (date-time) | — |
deleted_at | string (date-time) ou null | — |
customer | object ou null | — |
customer.id | string (UUID) | — |
customer.legal_name | string | — |
customer.trade_name | string ou null | — |
customer.tax_id | string ou null | — |
customer.tax_id_type | string ou null | — |
customer.country_code | string | — |
invoice | object ou null | — |
invoice.id | string (UUID) | — |
invoice.status | string | — |
invoice.reference_code | string ou null | — |
has_active_invoice | boolean | — |
is_imported | boolean | — |
financial_status | string ou null | Valores: open, partial, overdue, paid. |
items | array de objetos | — |
items[].id | string (UUID) | — |
items[].tenant_id | string (UUID) | — |
items[].sales_order_id | string (UUID) | — |
items[].product_id | string (UUID) | — |
items[].item_description | string | — |
items[].quantity | string | — |
items[].unit_price | string | — |
items[].discount_amount | string | — |
items[].subtotal | string | — |
items[].total | string | — |
items[].position | integer | — |
items[].created_by_user_id | string (UUID) ou null | — |
items[].updated_by_user_id | string (UUID) ou null | — |
items[].deleted_by_user_id | string (UUID) ou null | — |
items[].created_at | string (date-time) | — |
items[].updated_at | string (date-time) | — |
items[].deleted_at | string (date-time) ou null | — |
items[].product | object ou null | — |
receivables | array de objetos | — |
receivables[].id | string (UUID) | — |
receivables[].reference_code | string ou null | — |
receivables[].status | string | Valores: pending, partial, paid, overdue, cancelled. |
receivables[].amount | string | — |
receivables[].due_date | string (date) | — |
receivables[].paid_at | string (date-time) ou null | — |
receivables[].payment_method_id | string (UUID) ou null | — |
receivables[].financial_account_id | string (UUID) | — |
receivables[].installment_number | integer ou null | — |
receivables[].installment_count | integer ou null | — |
receivables[].description | string ou null | — |
has_active_receivables | boolean | — |
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.
Além dos parâmetros obrigatórios, a tool exige exatamente um destes: id, record_number. Sem nenhum, ou com mais de um, ela responde ValidationError. O exemplo usa record_number.
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "get_sales_order",
"arguments": {
"tenant": "minha-empresa",
"record_number": 42
}
}
}
