allocate_payable_transaction
Referência da tool allocate_payable_transaction do MCP Server do bitERP (Contas a pagar).
Allocate Transaction to Payable · Contas a pagar
| Somente leitura | Destrutiva | Idempotente | Mundo aberto |
|---|---|---|---|
| Não | Sim | Não | 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.
Allocates an existing ERP financial transaction entry to one payable record for internal reconciliation. When the allocated amount exceeds the title balance, the surplus MUST be explained through difference_components (interest, fine, bank fee or contractual surcharge) — money that moved through the bank always belongs to some title. Amounts below the balance are a partial payment and need no components.
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. |
payable_id | string (UUID) | Sim | The payable ID to allocate the transaction to |
financial_transaction_id | string (UUID) | Sim | The financial transaction ID to allocate |
allocated_amount | decimal (string ou number) | Sim | Amount to allocate as decimal string (numeric(18,6), e.g. "1500.000000"); a JSON number with at most 6 decimals is also accepted |
notes | string | Não | Notes about this allocation |
difference_components | array de objetos | Não | Components that make up the difference between the allocated amount and the title balance. Required when the allocated amount exceeds the balance; must add up to that difference. Omit for an exact match or a partial payment. |
difference_components[].type | string | Sim | Business nature of this slice of the difference. interest/fine/bank_fee create a charge title; surcharge/discount adjust the origin title balance; partial is the residue left open. Valores: interest, fine, bank_fee, surcharge, discount, partial. |
difference_components[].amount | decimal (string ou number) | Sim | Absolute magnitude of this component as decimal string (numeric(18,6), e.g. "1500.000000"); a JSON number with at most 6 decimals is also accepted, always positive |
difference_components[].financial_category_id | string (UUID) | Não | Financial category for the charge title. Required for interest/fine/bank_fee; rejected for the other types. |
difference_components[].counterparty_id | string (UUID) | Não | Counterparty for the charge title. Required for bank_fee (the bank as a supplier); rejected for every other type. |
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) | — |
payable_id | string (UUID) | — |
financial_transaction_id | string (UUID) | — |
allocated_amount | string | — |
reverses_allocation_id | string (UUID) ou null | — |
discount_delta | string | — |
surcharge_delta | string | — |
notes | 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 | — |
_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": "allocate_payable_transaction",
"arguments": {
"tenant": "minha-empresa",
"payable_id": "<uuid>",
"financial_transaction_id": "<uuid>",
"allocated_amount": "100.00"
}
}
}
