Skip to main content
Glama

update_company

Idempotent

Fill in or fix the company's own address and fiscal fields — what get_company_readiness reports missing.

Before calling it: read the company's own registry row with lookup_taxpayer (its CNPJ), show the user the address you are about to write, and call only after they confirm it. Never invent or guess a field; leave out what neither the registry nor the user gave. The state cannot change here.

The registry row keeps street_type, street, number and neighborhood under metadata.address and the CEP as postal_code. Its city_code is the Receita's code (4 digits), not IBGE, and it has no city name: get the name with lookup_fiscal_code(kind="city", code=<city_code>) and send it as municipality_name, or send search_cities' 7-digit code as municipality_code.

The fiscal fields (tax_regime, simples_nacional, simples_apuracao, simples_apuracao_ibs_cbs, state_registration, service_code, municipal_registration, special_tax_regime, iss_rate and the approximate_tax_*percent ones) decide what every future document declares and owes: send them only when the user states them, never from a registry suggestion alone. They are the company owner's alone. An empty string clears municipal_registration, iss_rate and the approximate_tax*_percent ones.

Only what is sent changes. Answers with the readiness fields plus the address and fiscal fields as stored: when ready is true the company can issue, with no need to ask get_company_readiness again. Needs company:write.

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": "update_company"
  }
}

Input Schema

NameRequiredDescriptionDefault
numberNoStreet number, or SN when there is none.
streetNoStreet (logradouro).
iss_rateNoISSQN rate in percent, above 0 and at most 5.
zip_codeNoCEP, 8 digits; the mask is fine.
company_idNoUUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both.
tax_regimeNoCRT: 1 Simples, 2 Simples excesso, 3 normal, 4 MEI.
neighborhoodNoNeighborhood (bairro).
service_codeNoDefault NFS-e service code (cTribNac), e.g. 01.07.00.
company_tax_idNoCNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both.
simples_apuracaoNoNFS-e regApTribSN of an ME/EPP: 1, 2 or 3.
simples_nacionalNoNFS-e Simples Nacional option (opSimpNac): 1 no, 2 MEI, 3 ME/EPP.
municipality_codeNoThe 7-digit IBGE code of a city in the company's state (search_cities finds it). Never the registry's 4-digit city_code, padded or not. Leave it out to send municipality_name.
municipality_nameNoThe city's name; the IBGE code is found from it in the company's state. Send it or municipality_code; both must agree.
special_tax_regimeNoNFS-e regEspTrib: 0 none, 1 cooperative, 2 estimativa, 3 municipal microempresa, 4 notario/registrador, 5 autonomo, 6 sociedade de profissionais, 9 other. An MEI, and an ME/EPP with simples_apuracao 1, take only 0.
state_registrationNoState registration (IE), digits or ISENTO; an NF-e needs it.
municipal_registrationNoInscricao municipal (provider IM), up to 15 letters or digits.
block_activity_mismatchNoOwner only. True refuses, False only warns.
simples_apuracao_ibs_cbsNoHow an ME/EPP pays IBS/CBS: 1 in the DAS, 3 outside it; only 3 lets its NFS-e carry the IBS/CBS group in production.
approximate_tax_state_percentNoLei 12.741 approximate tax percentage, 0 to 100.
approximate_tax_federal_percentNoLei 12.741 approximate tax percentage, 0 to 100.
approximate_tax_simples_percentNoME/EPP Simples approximate tax percentage (Lei 12.741), 0 to 99.99.
approximate_tax_municipal_percentNoLei 12.741 approximate tax percentage, 0 to 100.

Output Schema

NameRequiredDescriptionDefault
nameNo
readyNoAt least one document type can be issued.
stateNo
tax_idNo
addressNoThe issuer address as stored.
fix_urlNoThe dashboard screen that fixes the first blocker. Null when nothing blocks.
missingNoWhy not: certificate, certificate_expired, certificate_unreadable, address, state_registration, plan. Empty when ready.
company_idNo
tax_regimeNoCRT: 1 Simples, 2 Simples excesso, 3 normal, 4 MEI.
environmentNohomologation or production.
fiscal_fieldsNoThe fiscal fields as stored, where set.
default_seriesNoThe série used per document type when none is sent.
has_certificateNo
by_document_typeNoPer nfe/nfse: ready, missing [{code, fields}] with the fields at fault, and warnings [{code}] for a default being declared (tax_regime_default, simples_nacional_default, service_code_default).
certificate_expires_atNo
suggested_fiscal_fieldsNoWhat the CNPJ registry suggests for tax_regime and simples_nacional. A suggestion for the user to confirm, never applied.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / block_activity_mismatch
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Owner only. True refuses, False only warns."
      +}
  2. Changed9 schema fields changed
    • addedInput schema / properties / approximate_tax_federal_percent
      Added value: +{
      +  "anyOf": [
      +    {
      +      "pattern": "^([0-9]{1,3}([.,][0-9]{1,2})?)?$",
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Lei 12.741 approximate tax percentage, 0 to 100."
      +}
    • addedInput schema / properties / approximate_tax_municipal_percent
      Added value: +{
      +  "anyOf": [
      +    {
      +      "pattern": "^([0-9]{1,3}([.,][0-9]{1,2})?)?$",
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Lei 12.741 approximate tax percentage, 0 to 100."
      +}
    • addedInput schema / properties / approximate_tax_simples_percent
      Added value: +{
      +  "anyOf": [
      +    {
      +      "pattern": "^([0-9]{1,3}([.,][0-9]{1,2})?)?$",
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "ME/EPP Simples approximate tax percentage (Lei 12.741), 0 to 99.99."
      +}
    • addedInput schema / properties / approximate_tax_state_percent
      Added value: +{
      +  "anyOf": [
      +    {
      +      "pattern": "^([0-9]{1,3}([.,][0-9]{1,2})?)?$",
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Lei 12.741 approximate tax percentage, 0 to 100."
      +}
    • addedInput schema / properties / iss_rate
      Added value: +{
      +  "anyOf": [
      +    {
      +      "pattern": "^([0-9]{1,3}([.,][0-9]{1,2})?)?$",
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "ISSQN rate in percent, above 0 and at most 5."
      +}
    • addedInput schema / properties / municipal_registration
      Added value: +{
      +  "anyOf": [
      +    {
      +      "pattern": "^[A-Za-z0-9]{0,15}$",
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Inscricao municipal (provider IM), up to 15 letters or digits."
      +}
    • addedInput schema / properties / simples_apuracao
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "1",
      +        "2",
      +        "3"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "NFS-e regApTribSN of an ME/EPP: 1, 2 or 3."
      +}
    • addedInput schema / properties / simples_apuracao_ibs_cbs
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "1",
      +        "3"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "How an ME/EPP pays IBS/CBS: 1 in the DAS, 3 outside it; only 3 lets its NFS-e carry the IBS/CBS group in production."
      +}
    • addedInput schema / properties / special_tax_regime
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "0",
      +        "1",
      +        "2",
      +        "3",
      +        "4",
      +        "5",
      +        "6",
      +        "9"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "NFS-e regEspTrib: 0 none, 1 cooperative, 2 estimativa, 3 municipal microempresa, 4 notario/registrador, 5 autonomo, 6 sociedade de profissionais, 9 other. An MEI, and an ME/EPP with simples_apuracao 1, take only 0."
      +}
  3. Changed2 schema fields changed
    • changedInput schema / properties / company_id / description
      Previous value: -"UUID of the company acted for. Omit it if the connection covers a single company; else see list_authorized_companies. company_id or company_tax_id, never both."New value: +"UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
    • changedInput schema / properties / company_tax_id / description
      Previous value: -"CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit it if the connection covers a single company; else see list_authorized_companies. company_id or company_tax_id, never both."New value: +"CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
  4. Changed2 schema fields changed
    • changedInput schema / properties / company_id / description
      Previous value: -"UUID of the company this call acts for. Omit it when the connection covers a single company; with several it is required (see list_authorized_companies). Send company_id or company_tax_id, never both."New value: +"UUID of the company acted for. Omit it if the connection covers a single company; else see list_authorized_companies. company_id or company_tax_id, never both."
    • changedInput schema / properties / company_tax_id / description
      Previous value: -"CNPJ or CPF of the company this call acts for, never the recipient or a taxpayer being looked up. Omit it when the connection covers a single company; with several it is required (see list_authorized_companies). Send company_id or company_tax_id, never both."New value: +"CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit it if the connection covers a single company; else see list_authorized_companies. company_id or company_tax_id, never both."
  5. Added

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the annotations it discloses patch semantics ('Only what is sent changes'), a clearing convention (empty string clears municipal_registration, iss_rate and the approximate_tax_*_percent fields), a permission requirement (needs company:write), and an ownership constraint for fiscal fields. It also explains the response shape and that a ready=true result removes the need to re-call get_company_readiness. These are exactly the behaviors annotations cannot express.

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?

The description is long but organized into purpose, preconditions, address mapping, fiscal-field policy, and return behavior, with the most decision-relevant constraints up front. A few sentences (particularly the enumeration of fiscal field names) are denser than strictly necessary, but nothing is redundant 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?

For a 22-parameter mutation tool with zero required parameters, the description covers the prerequisites, the cross-field data provenance rules, the clearing convention, the permission needed, and how the response ties back to readiness. An output schema exists, so return values need no further detail, and nothing an agent needs to call this safely is missing.

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

Parameters5/5

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

Although schema coverage is 100%, the description adds meaning the schema cannot: the registry row stores street_type/street/number/neighborhood under metadata.address and the CEP as postal_code, and city_code is the Receita's 4-digit code rather than IBGE. It also explains the municipality_name vs municipality_code choice and the governance rule that fiscal fields come only from the user, not from a registry suggestion.

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?

The first sentence gives a specific verb (fill in or fix) and a specific resource (the company's own address and fiscal fields), and it anchors the tool to what get_company_readiness reports as missing, distinguishing it from read-only siblings. It also states the scope boundary ('the state cannot change here'). An agent can tell immediately what this tool mutates and what it does not.

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

Usage Guidelines5/5

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

It names an explicit pre-call sequence: read the registry row with lookup_taxpayer, show the user the address, and call only after confirmation. It also gives a negative rule ('never invent or guess a field; leave out what neither the registry nor the user gave') and routes to alternatives for the municipality problem (lookup_fiscal_code(kind="city") or search_cities). When-to-use, when-not, and alternatives are all present.

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.