Skip to main content
Glama

Arquivix Notas · NFS-e

nfse_calculate

Read-onlyIdempotent

Calculate taxes before issuing, without issuing a document, reserving credits or creating a DPS. By default it is for an NFS-e (amount, service_code...). With type "nfe" or "nfce" it previews the taxes of goods for a Simples Nacional company: send company_id and the nfe object with items[] {ncm, cfop, quantity, unitPrice, origin?, tax? {csosn, pCredSN?}} (recipient and payments are not needed). Per item it returns vTotTrib and approximateTaxes (Lei 12.741/2012, IBPT table of the UF of the issuer: federal, state, municipal, total, percent, source, version), icmsSn with the credit of CSOSN 101 (pCredSN, vCredICMSSN; the company rate comes from its NF-e settings) and ibsCbs (null while the NF-e does not require it), then totals and warnings. An NCM missing in the IBPT table gives a warning and no vTotTrib: Arquivix Notas never guesses a rate. Issuing and validating fill the same values in the note; values sent in the item win.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "nfse_calculate"
  }
}

Input Schema

NameRequiredDescriptionDefault
nfeNoOnly with type "nfe" or "nfce": items[] {ncm, cfop, quantity, unitPrice, discount?, freight?, insurance?, other?, vTotTrib?, origin?, tax? {csosn, origin?, pCredSN?, vCredICMSSN?}}, same fields as the note; recipient and payments are optional here.
typeNoWhat to calculate: "nfse" (default, a service), "nfe" (goods, model 55) or "nfce" (sale to the consumer, model 65).nfse
amountNoValor do serviço em reais, ex.: 1500.00.
deductionNoDeduction from the ISS tax base in BRL, declared by the issuer.
company_idNoUUID da empresa emissora.
descriptionNoDescrição do serviço (opcional).
service_codeNoCódigo de serviço cTribNac com 6 dígitos, ex.: "010101"; padrão o da empresa.
company_tax_idNoCNPJ da empresa emissora, só dígitos; alternativa a company_id.
competence_dateNoData de competência AAAA-MM-DD; padrão hoje (horário de Brasília).
municipality_codeNoCódigo IBGE do município com 7 dígitos, ex.: "2304400"; padrão o da empresa.

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly/idempotent/non-destructive, yet the description adds the substantive guarantee that nothing is persisted — no document, no credit reservation, no DPS. It also discloses edge-case behavior (a missing NCM yields a warning and no vTotTrib because rates are never guessed) and a precedence rule (values sent in the item win over filled-in ones).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the highest-value constraint (calculates without issuing) before the per-type details. The middle section is a dense run-on packing field names and return fields, but nearly every clause carries operational information rather than filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema and ten optional parameters, the description compensates by describing the return shape item by item (vTotTrib, approximateTaxes with federal/state/municipal breakdown, icmsSn credit, ibsCbs null, totals, warnings). It also explains the IBPT/Lei 12.741 legal basis for the tax figures, which an agent needs to interpret them.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning: it enumerates the items[] shape (ncm, cfop, quantity, unitPrice, origin, tax.csosn, pCredSN), states that recipient and payments are not required, and explains that the CSOSN 101 credit rate comes from the company's NF-e settings rather than a parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Calculate taxes") plus the crucial negative scope: "without issuing a document, reserving credits or creating a DPS." It also distinguishes two modes (default NFS-e service vs. type "nfe"/"nfce" goods preview), so an agent can tell it apart from nfse_issue without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear when-to-use context: run this before issuing to preview taxes, and notes that issuing/validating fill the same values, which implies the handoff. It does not explicitly name nfse_issue or nfse_review as the alternative to pick when the goal is an actual document, so the routing is inferable rather than stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources