biterp

get_budget_variance

Referência da tool get_budget_variance do MCP Server do bitERP (Planejamento orçamentário).

Get Budget Variance · Planejamento orçamentário

Somente leituraDestrutivaIdempotenteMundo aberto
SimNãoSimNã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.

Planned vs actual per financial category over a period of months (budget variance), as a tree in code order, one block per category type. planned: the category own budget; without one, the sum of its children, month by month. actual: the titles of the category and its descendants, the same source as the income statement. variance = actual - planned; consumed_percentage = actual / planned x 100 (null when planned = 0). consumption_status (expense rows with planned > 0 only): within (below 80%), warning (from 80% up to 100%, "near the limit") or exceeded (above 100%, "over budget"); answer "near the limit" or "over budget" from this field, never recompute it. Rows with financial_category_id = null are the "uncategorized" line of the block (titles without a category), with no planned value. Balance sheet categories (credit card statement) are out. When the period is exactly one closed month (meta.closing set), actual is the value frozen at the closing, actual_live is the value recomputed now and drift = actual_live - actual (e.g. a title reassigned after the closing); report both when drift is not zero. meta.closed_months lists the closed months of the period; meta.notes explains the basis. Money is a decimal string in meta.currency.

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.
basisstringSimaccrual = titles by issue date (income statement view); cash = settlements by posting date (cash view). The planned value is the same in both. Valores: accrual, cash.
from_monthstringSimFirst month (YYYY-MM), inclusive
to_monthstringSimLast month (YYYY-MM), inclusive. At most 12 months in the period.
category_typestringSimexpense (needs payables:read), revenue (needs receivables:read) or all (needs both). Without the permission the whole request is refused. Valores: revenue, expense, all.
max_depthintegerNãoTree levels returned, counting the roots as level 1 (default 2). Deeper rows are left out, never their numbers: a shallower row already carries the rollup. Raise it when the user asks about a deeper category (meta.omitted_rows > 0).

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
rowsarray de objetos—
rows[].financial_category_idstring (UUID) ou null—
rows[].parent_idstring (UUID) ou null—
rows[].codestring ou null—
rows[].namestring ou null—
rows[].depthinteger—
rows[].typestringValores: revenue, expense.
rows[].has_own_budgetboolean—
rows[].plannedstring—
rows[].actualstring—
rows[].variancestring—
rows[].consumed_percentagestring ou null—
rows[].consumption_statusstring ou nullValores: within, warning, exceeded.
rows[].actual_livestring—
rows[].driftstring—
metaobject—
meta.basisstringValores: accrual, cash.
meta.currencystring—
meta.periodobject—
meta.warning_threshold_percentagestring—
meta.notesarray de string—
meta.closingobject ou null—
meta.closed_monthsarray de string—
meta.max_depthinteger—
meta.omitted_rowsinteger—

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": "get_budget_variance",
        "arguments": {
            "tenant": "minha-empresa",
            "basis": "accrual",
            "from_month": "2026-01",
            "to_month": "2026-01",
            "category_type": "revenue"
        }
    }
}

Nesta página