get_company_readiness
Whether the company can issue right now, and if not, what to fix.
Call it before a company's first document, and when issuing fails for a reason that is not the document's. ready is false with missing naming the cause; by_document_type has it per nfe and nfse, each blocker with the fields at fault and each warning a default being declared; fix_url is the dashboard screen for the first blocker.
What to do with it:
address: offer to fill it in here. Read the company's own registry row with lookup_taxpayer, show the user the address, and call update_company once they confirm.
state_registration: ask the user for the IE, then update_company.
certificate, certificate_expired, certificate_unreadable, plan: only the dashboard fixes them; give the user fix_url.
update_company refused for lack of company:write: give fix_url and tell the user to reconnect Stackin to allow company settings.
Do not call it again until something changed — an update_company, or the user saying they fixed it: the answer will be the same. Also the certificate's expiry, the tax regime (CRT), the state, the default série per document type and what the registry suggests for the fiscal fields. Read-only.
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": "get_company_readiness"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| company_id | No | UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both. | |
| company_tax_id | No | 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. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| ready | No | At least one document type can be issued. | |
| state | No | ||
| tax_id | No | ||
| fix_url | No | The dashboard screen that fixes the first blocker. Null when nothing blocks. | |
| missing | No | Why not: certificate, certificate_expired, certificate_unreadable, address, state_registration, plan. Empty when ready. | |
| company_id | No | ||
| tax_regime | No | CRT: 1 Simples, 2 Simples excesso, 3 normal, 4 MEI. | |
| environment | No | homologation or production. | |
| default_series | No | The série used per document type when none is sent. | |
| has_certificate | No | ||
| by_document_type | No | Per 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_at | No | ||
| suggested_fiscal_fields | No | What the CNPJ registry suggests for tax_regime and simples_nacional. A suggestion for the user to confirm, never applied. |