Skip to main content
Glama

Consulta de tabelas SIDRA

ibge_sidra
Read-onlyIdempotent

Queries SIDRA tables (IBGE's Automatic Recovery System).

SIDRA contains data from IBGE surveys like Census, PNAD, GDP, etc.

Common tables:

  • 6579: Population estimates (annual)

  • 9514: Census 2022 population

  • 200: Census population (1970-2010)

  • 4714: Population, territorial area and density (Census 2022)

  • 4099: Unemployment rate (PNAD Contínua, quarterly)

  • 5436: Average real income (PNAD Contínua, quarterly)

  • 6706: GDP at current prices

  • 5938: GDP per capita

Territorial levels:

  • 1: Brazil

  • 2: Region (North, Northeast, etc.)

  • 3: State (UF)

  • 6: Municipality

  • 7: Metropolitan Region

Examples:

  • Brazil population 2023: tabela="6579", periodos="2023"

  • Population by state: tabela="6579", nivel_territorial="3"

  • Census 2022 by municipality: tabela="9514", nivel_territorial="6", localidades="3550308"

Statistics mode: for largest/smallest/mean/median/distribution/ranking questions ("which municipality has the largest population?", "median GDP by state") use estatisticas=true — it computes min/max/mean/median/std-dev/labeled percentiles over ALL data rows BEFORE pagination and returns top/bottom rankings (default 10, cap 100 via topN), so one call answers what would otherwise require paging thousands of records. With agruparPor="" (e.g. "Unidade da Federação", "Ano") it ranks groups by descending sum, each with its own mini-distribution. Queries mixing several variables auto-group by "Variável" (units differ). SIDRA absence markers ("-", "..", "...", "X") are excluded from n. In this mode pagina/campos/formato are ignored and registros comes empty. The query itself still respects SIDRA's official cap of 100,000 values.

ibge_sidra is the low-level engine. Prefer a friendlier wrapper when it fits:

  • Census themes (1970–2022) → ibge_censo

  • Economic/social time series → ibge_indicadores

  • Rank/compare 2–10 localities → ibge_comparar

  • One municipality's panel → ibge_cidades Use ibge_sidra_tabelas and ibge_sidra_metadados to find a table code and its structure before querying.

Behavior: read-only and idempotent — a live GET against the public IBGE SIDRA API. Returns Markdown plus a typed structuredContent payload.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topNNoTamanho das listas top/bottom quando estatisticas=true sem agruparPor (padrão: 10, máx: 100)
camposNoSelecionar apenas algumas colunas por rótulo, separadas por vírgula (ex: 'Valor,Ano'). Reduz o volume da resposta. Omitir traz todas.
paginaNoPágina de resultados (100 registros por página)
tabelaYesCódigo da tabela SIDRA (ex: 6579 para estimativas de população, 9514 para censo 2022)
formatoNoFormato de saída: 'json' para dados brutos ou 'tabela' para formato legíveltabela
periodosNoPeríodos: 'last' para último, 'all' para todos, ou anos específicos (ex: 2020,2021,2022)last
variaveisNoIDs das variáveis separados por vírgula, ou 'allxp' para todasallxp
agruparPorNoCom estatisticas=true, agrupa pela coluna informada (rótulo, ex: 'Unidade da Federação', 'Ano') e ranqueia os grupos por soma decrescente (grupos[0] = maior total), cada grupo com sua mini-distribuição
localidadesNoCódigos das localidades separados por vírgula, ou 'all' para todasall
estatisticasNoComputa estatísticas (mínimo/máximo/média/mediana/desvio-padrão/percentis) sobre TODOS os registros da consulta, antes da paginação, + ranking top/bottom. Use para 'qual o maior/menor', 'média', 'mediana', 'distribuição', 'ranking'. Quando true, ignora pagina, campos e formato
classificacoesNoClassificações no formato 'id[categorias]' (ex: '2[6794]' para sexo masculino)
nivel_territorialNoNível territorial (código N): 1=Brasil, 2=Região, 3=UF, 6=Município, 7=Região Metropolitana, 8=Mesorregião, 9=Microrregião, 10=Distrito, 11=Subdistrito, 13=RM/RIDE, 14=RIDE, 15=Aglomeração Urbana, 17=Região Geográfica Imediata, 18=Região Geográfica Intermediária, 105=Macrorregião de Saúde, 106=Região de Saúde, 114=Aglomerado Subnormal, 127=Amazônia Legal, 128=Semiárido1

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
nomeYesNome da tabela (quando conhecido)
tabelaYesCódigo da tabela SIDRA consultada
colunasYesRótulos das colunas, na ordem
paginacaoYesMetadados de paginação para continuação
registrosYesRegistros da página atual: cada um mapeia rótulo da coluna -> valor
provenanceYesBloco de proveniência (contrato v1.0): fonte, URL, período, extração e licença
attributionYesURLs canônicas das fontes desta resposta (lista de atribuição)
estatisticasNoBloco estatístico presente quando estatisticas=true (registros vem vazio nesse modo)
totalRegistrosYesTotal de registros de dados disponíveis (todas as páginas)

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations (readOnlyHint, openWorldHint, idempotentHint, destructiveHint=false) already cover the safety profile, so the bar is raised — and the description clears it. It adds the concrete mechanism ('a live GET against the public IBGE SIDRA API'), the return shape ('Markdown plus a typed structuredContent payload'), and several non-obvious behaviors: estatisticas=true ignores pagina/campos/formato, processes ALL rows before pagination, returns an empty registros, excludes SIDRA absence markers, and respects the 100,000-value cap. This is exactly the hard-won context 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?

Well-structured and front-loaded: definition → common tables → territorial levels → examples → complex stats mode → sibling routing → behavior statement. The length is justified by 12 parameters and a genuinely complex special mode, and each section earns its place. It is not maximally tight — the territorial-level list repeats schema content and the statistics paragraph is dense — but the organization compensates.

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 12-parameter low-level engine with 22 siblings, the description covers everything needed to select and invoke it correctly: purpose, data scope, common table codes, examples, special-mode behavior, parameter interactions, cap limits, sibling routing, and safety profile. An output schema exists, so return-value details need no elaboration here. No material gap remains.

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 description coverage is 100%, so the schema already documents every parameter and the baseline is 3. The description earns a point above baseline by supplying real table-code examples ('tabela="6579", periodos="2023"', 'localidades="3550308"'), a curated quick-reference of territorial levels, and cross-parameter semantics: estatisticas=true ignoring pagina/campos/formato, agruparPor ranking behavior ('grupos[0] = maior total'), and SIDRA absence markers excluded from n. The territorial-level list partially duplicates the schema's nivel_territorial description, which prevents a 5.

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 — 'Queries SIDRA tables (IBGE's Automatic Recovery System)' — and immediately distinguishes itself from siblings: 'ibge_sidra is the low-level engine. Prefer a friendlier wrapper when it fits,' naming ibge_censo, ibge_indicadores, ibge_comparar, and ibge_cidades. An agent can tell this tool apart from the rest of the 22-tool family from the description alone.

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?

Provides explicit when-to-use routing with conditions: Census themes → ibge_censo, economic/social time series → ibge_indicadores, rank/compare 2–10 localities → ibge_comparar, one-municipality panel → ibge_cidades, and directs the agent to ibge_sidra_tabelas and ibge_sidra_metadados before querying. It also defines when the estatisticas=true mode is the right choice: 'for largest/smallest/mean/median/distribution/ranking questions'.

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.