ibge-br-mcp 3.0.2 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -2
- package/README.pt-BR.md +17 -2
- package/dist/index.js +7 -11
- package/dist/index.js.map +1 -1
- package/dist/prompts.d.ts +1 -1
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +4 -4
- package/dist/prompts.js.map +1 -1
- package/dist/resources.d.ts +1 -1
- package/dist/resources.d.ts.map +1 -1
- package/dist/server.d.ts +11 -3
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +87 -113
- package/dist/server.js.map +1 -1
- package/dist/structured.d.ts +1 -1
- package/dist/structured.d.ts.map +1 -1
- package/dist/tools/calendario.d.ts +8 -62
- package/dist/tools/calendario.d.ts.map +1 -1
- package/dist/tools/censo.d.ts +36 -37
- package/dist/tools/censo.d.ts.map +1 -1
- package/dist/tools/censo.js +1 -1
- package/dist/tools/censo.js.map +1 -1
- package/dist/tools/cidades.d.ts +9 -42
- package/dist/tools/cidades.d.ts.map +1 -1
- package/dist/tools/cnae.d.ts +22 -155
- package/dist/tools/cnae.d.ts.map +1 -1
- package/dist/tools/comparar.d.ts +19 -68
- package/dist/tools/comparar.d.ts.map +1 -1
- package/dist/tools/datasaude.d.ts +8 -33
- package/dist/tools/datasaude.d.ts.map +1 -1
- package/dist/tools/datasaude.js +1 -1
- package/dist/tools/datasaude.js.map +1 -1
- package/dist/tools/estados.d.ts +15 -37
- package/dist/tools/estados.d.ts.map +1 -1
- package/dist/tools/geocodigo.d.ts +12 -82
- package/dist/tools/geocodigo.d.ts.map +1 -1
- package/dist/tools/indicadores.d.ts +16 -36
- package/dist/tools/indicadores.d.ts.map +1 -1
- package/dist/tools/indicadores.js +1 -1
- package/dist/tools/indicadores.js.map +1 -1
- package/dist/tools/localidade.d.ts +19 -133
- package/dist/tools/localidade.d.ts.map +1 -1
- package/dist/tools/malhas-tema.d.ts +28 -47
- package/dist/tools/malhas-tema.d.ts.map +1 -1
- package/dist/tools/malhas.d.ts +32 -36
- package/dist/tools/malhas.d.ts.map +1 -1
- package/dist/tools/municipios.d.ts +3 -33
- package/dist/tools/municipios.d.ts.map +1 -1
- package/dist/tools/nomes.d.ts +28 -139
- package/dist/tools/nomes.d.ts.map +1 -1
- package/dist/tools/noticias.d.ts +7 -68
- package/dist/tools/noticias.d.ts.map +1 -1
- package/dist/tools/paises.d.ts +20 -168
- package/dist/tools/paises.d.ts.map +1 -1
- package/dist/tools/pesquisas.d.ts +9 -78
- package/dist/tools/pesquisas.d.ts.map +1 -1
- package/dist/tools/populacao.d.ts +6 -34
- package/dist/tools/populacao.d.ts.map +1 -1
- package/dist/tools/sidra-metadados.d.ts +9 -161
- package/dist/tools/sidra-metadados.d.ts.map +1 -1
- package/dist/tools/sidra-tabelas.d.ts +3 -37
- package/dist/tools/sidra-tabelas.d.ts.map +1 -1
- package/dist/tools/sidra.d.ts +9 -60
- package/dist/tools/sidra.d.ts.map +1 -1
- package/dist/tools/sidra.js +1 -1
- package/dist/tools/sidra.js.map +1 -1
- package/dist/tools/vizinhos.d.ts +4 -54
- package/dist/tools/vizinhos.d.ts.map +1 -1
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -4,11 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/ibge-br-mcp)
|
|
6
6
|
[](https://www.npmjs.com/package/ibge-br-mcp)
|
|
7
|
+
[](https://www.npmjs.com/package/ibge-br-mcp)
|
|
8
|
+
[](https://registry.modelcontextprotocol.io)
|
|
9
|
+
[](https://lobehub.com/mcp/sidneybissoli-ibge-br-mcp)
|
|
10
|
+
[](https://smithery.ai/server/sidneybissoli/ibge-br-mcp)
|
|
11
|
+
[](https://glama.ai/mcp/servers/@SidneyBissoli/ibge-br-mcp)
|
|
7
12
|
[](https://github.com/SidneyBissoli/ibge-br-mcp)
|
|
8
13
|
[](https://github.com/SidneyBissoli/ibge-br-mcp)
|
|
14
|
+
[](https://github.com/SidneyBissoli/ibge-br-mcp)
|
|
15
|
+
[](https://github.com/sponsors/SidneyBissoli)
|
|
9
16
|
[](https://opensource.org/licenses/MIT)
|
|
10
|
-
[](https://smithery.ai/server/sidneybissoli/ibge-br-mcp)
|
|
11
|
-
[](https://glama.ai/mcp/servers/@SidneyBissoli/ibge-br-mcp)
|
|
12
17
|
|
|
13
18
|
**Live, exact Brazilian public data for your AI assistant — with provenance, not guesswork.**
|
|
14
19
|
|
|
@@ -18,6 +23,16 @@ Ask an LLM _"what was Belo Horizonte's population in the 2022 Census?"_ and you
|
|
|
18
23
|
|
|
19
24
|
This server implements the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) to give AI assistants live, structured access to Brazil's public geographic, demographic, economic, and health data — sourced from the IBGE APIs (including health indicators served through IBGE's SIDRA system).
|
|
20
25
|
|
|
26
|
+
## See it in action
|
|
27
|
+
|
|
28
|
+
Ask your assistant, in plain Portuguese:
|
|
29
|
+
|
|
30
|
+
- *"Qual era a população de Belo Horizonte no Censo 2022?"* → `ibge_cidades` / `ibge_censo`
|
|
31
|
+
- *"Liste os municípios do Espírito Santo."* → `ibge_municipios`
|
|
32
|
+
- *"Compare o PIB per capita das capitais do Sudeste."* → `ibge_comparar`
|
|
33
|
+
|
|
34
|
+
The answers come live from the official IBGE APIs — exact figures with the table and period they came from, not numbers guessed from training data.
|
|
35
|
+
|
|
21
36
|
## Features
|
|
22
37
|
|
|
23
38
|
- **22 specialized tools** covering all major IBGE data domains
|
package/README.pt-BR.md
CHANGED
|
@@ -4,11 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/ibge-br-mcp)
|
|
6
6
|
[](https://www.npmjs.com/package/ibge-br-mcp)
|
|
7
|
+
[](https://www.npmjs.com/package/ibge-br-mcp)
|
|
8
|
+
[](https://registry.modelcontextprotocol.io)
|
|
9
|
+
[](https://lobehub.com/mcp/sidneybissoli-ibge-br-mcp)
|
|
10
|
+
[](https://smithery.ai/server/sidneybissoli/ibge-br-mcp)
|
|
11
|
+
[](https://glama.ai/mcp/servers/@SidneyBissoli/ibge-br-mcp)
|
|
7
12
|
[](https://github.com/SidneyBissoli/ibge-br-mcp)
|
|
8
13
|
[](https://github.com/SidneyBissoli/ibge-br-mcp)
|
|
14
|
+
[](https://github.com/SidneyBissoli/ibge-br-mcp)
|
|
15
|
+
[](https://github.com/sponsors/SidneyBissoli)
|
|
9
16
|
[](https://opensource.org/licenses/MIT)
|
|
10
|
-
[](https://smithery.ai/server/sidneybissoli/ibge-br-mcp)
|
|
11
|
-
[](https://glama.ai/mcp/servers/@SidneyBissoli/ibge-br-mcp)
|
|
12
17
|
|
|
13
18
|
**Dados públicos brasileiros ao vivo e exatos para o seu assistente de IA — com procedência, não chute.**
|
|
14
19
|
|
|
@@ -18,6 +23,16 @@ Pergunte a um LLM _"qual era a população de Belo Horizonte no Censo 2022?"_ e
|
|
|
18
23
|
|
|
19
24
|
Este servidor implementa o [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) para dar aos assistentes de IA acesso ao vivo e estruturado aos dados públicos geográficos, demográficos, econômicos e de saúde do Brasil — vindos das APIs do IBGE (inclusive os indicadores de saúde, servidos pelo SIDRA do IBGE).
|
|
20
25
|
|
|
26
|
+
## Veja na prática
|
|
27
|
+
|
|
28
|
+
Pergunte ao seu assistente, em português:
|
|
29
|
+
|
|
30
|
+
- *"Qual era a população de Belo Horizonte no Censo 2022?"* → `ibge_cidades` / `ibge_censo`
|
|
31
|
+
- *"Liste os municípios do Espírito Santo."* → `ibge_municipios`
|
|
32
|
+
- *"Compare o PIB per capita das capitais do Sudeste."* → `ibge_comparar`
|
|
33
|
+
|
|
34
|
+
As respostas vêm ao vivo das APIs oficiais do IBGE — valores exatos com a tabela e o período de onde vieram, não números chutados do treino.
|
|
35
|
+
|
|
21
36
|
## Recursos
|
|
22
37
|
|
|
23
38
|
- **22 ferramentas especializadas** cobrindo todos os principais domínios de dados do IBGE
|
package/dist/index.js
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { serveStdio } from "@modelcontextprotocol/server/stdio";
|
|
3
3
|
import { createServer, SERVER_NAME, SERVER_VERSION } from "./server.js";
|
|
4
4
|
/**
|
|
5
5
|
* Entry point: build the IBGE MCP Server and serve it over STDIO.
|
|
6
6
|
*
|
|
7
7
|
* Server construction lives in `server.ts` (side-effect-free, testable); this
|
|
8
|
-
* file only wires it to the STDIO transport
|
|
8
|
+
* file only wires it to the STDIO transport. `serveStdio` owns the connection:
|
|
9
|
+
* it pins one server instance from the factory per connection and serves both
|
|
10
|
+
* the modern and the 2025-era protocol openings. stdout is the MCP protocol
|
|
9
11
|
* channel, so all logging goes to stderr.
|
|
10
12
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const transport = new StdioServerTransport();
|
|
14
|
-
await server.connect(transport);
|
|
15
|
-
console.error(`${SERVER_NAME} v${SERVER_VERSION} started`);
|
|
16
|
-
}
|
|
17
|
-
main().catch((error) => {
|
|
18
|
-
console.error("Fatal error:", error);
|
|
19
|
-
process.exit(1);
|
|
13
|
+
serveStdio(() => createServer(), {
|
|
14
|
+
onerror: (error) => console.error("Transport error:", error),
|
|
20
15
|
});
|
|
16
|
+
console.error(`${SERVER_NAME} v${SERVER_VERSION} started`);
|
|
21
17
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAExE;;;;;;;;GAQG;AACH,UAAU,CAAC,GAAG,EAAE,CAAC,YAAY,EAAE,EAAE;IAC/B,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,kBAAkB,EAAE,KAAK,CAAC;CAC7D,CAAC,CAAC;AAEH,OAAO,CAAC,KAAK,CAAC,GAAG,WAAW,KAAK,cAAc,UAAU,CAAC,CAAC"}
|
package/dist/prompts.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* building a demographic profile — so users don't have to remember which tools
|
|
7
7
|
* to chain.
|
|
8
8
|
*/
|
|
9
|
-
import type { McpServer } from "@modelcontextprotocol/
|
|
9
|
+
import type { McpServer } from "@modelcontextprotocol/server";
|
|
10
10
|
/** Registers all analysis-template prompts on the server. */
|
|
11
11
|
export declare function registerPrompts(server: McpServer): void;
|
|
12
12
|
//# sourceMappingURL=prompts.d.ts.map
|
package/dist/prompts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAc9D,6DAA6D;AAC7D,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA6DvD"}
|
package/dist/prompts.js
CHANGED
|
@@ -24,7 +24,7 @@ export function registerPrompts(server) {
|
|
|
24
24
|
server.registerPrompt("comparar-municipios", {
|
|
25
25
|
title: "Comparar municípios",
|
|
26
26
|
description: "Compara 2 a 10 localidades (municípios ou UFs) em um indicador e produz um ranking comentado.",
|
|
27
|
-
argsSchema: {
|
|
27
|
+
argsSchema: z.object({
|
|
28
28
|
localidades: z
|
|
29
29
|
.string()
|
|
30
30
|
.describe("Localidades separadas por vírgula — códigos IBGE ou nomes (ex.: 'São Paulo, Rio de Janeiro, Belo Horizonte')"),
|
|
@@ -32,7 +32,7 @@ export function registerPrompts(server) {
|
|
|
32
32
|
.string()
|
|
33
33
|
.optional()
|
|
34
34
|
.describe("Indicador a comparar (ex.: populacao, pib, densidade, alfabetizacao). Padrão: populacao"),
|
|
35
|
-
},
|
|
35
|
+
}),
|
|
36
36
|
}, ({ localidades, indicador }) => {
|
|
37
37
|
const ind = indicador?.trim() || "populacao";
|
|
38
38
|
return userMessage(`Compare as seguintes localidades pelo indicador "${ind}": ${localidades}.
|
|
@@ -47,11 +47,11 @@ Passos:
|
|
|
47
47
|
server.registerPrompt("perfil-demografico", {
|
|
48
48
|
title: "Perfil demográfico",
|
|
49
49
|
description: "Monta um perfil demográfico de uma localidade combinando população, censo e indicadores socioeconômicos.",
|
|
50
|
-
argsSchema: {
|
|
50
|
+
argsSchema: z.object({
|
|
51
51
|
localidade: z
|
|
52
52
|
.string()
|
|
53
53
|
.describe("Município ou UF — código IBGE ou nome (ex.: '3550308' ou 'São Paulo')"),
|
|
54
|
-
},
|
|
54
|
+
}),
|
|
55
55
|
}, ({ localidade }) => userMessage(`Monte um perfil demográfico da localidade: ${localidade}.
|
|
56
56
|
|
|
57
57
|
Passos:
|
package/dist/prompts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,6EAA6E;AAC7E,SAAS,WAAW,CAAC,IAAY;IAC/B,OAAO;QACL,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAe;gBACrB,OAAO,EAAE,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE;aACzC;SACF;KACF,CAAC;AACJ,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,eAAe,CAAC,MAAiB;IAC/C,iDAAiD;IACjD,MAAM,CAAC,cAAc,CACnB,qBAAqB,EACrB;QACE,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EACT,+FAA+F;QACjG,UAAU,EAAE;
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,6EAA6E;AAC7E,SAAS,WAAW,CAAC,IAAY;IAC/B,OAAO;QACL,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAe;gBACrB,OAAO,EAAE,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE;aACzC;SACF;KACF,CAAC;AACJ,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,eAAe,CAAC,MAAiB;IAC/C,iDAAiD;IACjD,MAAM,CAAC,cAAc,CACnB,qBAAqB,EACrB;QACE,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EACT,+FAA+F;QACjG,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC;YACnB,WAAW,EAAE,CAAC;iBACX,MAAM,EAAE;iBACR,QAAQ,CACP,8GAA8G,CAC/G;YACH,SAAS,EAAE,CAAC;iBACT,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CACP,yFAAyF,CAC1F;SACJ,CAAC;KACH,EACD,CAAC,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,EAAE;QAC7B,MAAM,GAAG,GAAG,SAAS,EAAE,IAAI,EAAE,IAAI,WAAW,CAAC;QAC7C,OAAO,WAAW,CAChB,oDAAoD,GAAG,MAAM,WAAW;;;;6FAIa,GAAG;;0FAEN,CACnF,CAAC;IACJ,CAAC,CACF,CAAC;IAEF,+CAA+C;IAC/C,MAAM,CAAC,cAAc,CACnB,oBAAoB,EACpB;QACE,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EACT,0GAA0G;QAC5G,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC;YACnB,UAAU,EAAE,CAAC;iBACV,MAAM,EAAE;iBACR,QAAQ,CAAC,uEAAuE,CAAC;SACrF,CAAC;KACH,EACD,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CACjB,WAAW,CACT,8CAA8C,UAAU;;;;;;;iJAOiF,CAC1I,CACJ,CAAC;AACJ,CAAC"}
|
package/dist/resources.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* codes, biome codes — without guessing or spending a tool round-trip. Each is
|
|
7
7
|
* a static `ibge://catalogos/...` resource returning JSON.
|
|
8
8
|
*/
|
|
9
|
-
import type { McpServer } from "@modelcontextprotocol/
|
|
9
|
+
import type { McpServer } from "@modelcontextprotocol/server";
|
|
10
10
|
/** Registers all reference-catalog resources on the server. */
|
|
11
11
|
export declare function registerResources(server: McpServer): void;
|
|
12
12
|
//# sourceMappingURL=resources.d.ts.map
|
package/dist/resources.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAwF9D,+DAA+D;AAC/D,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAmEzD"}
|
package/dist/server.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { McpServer } from "@modelcontextprotocol/
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/server";
|
|
2
2
|
export declare const SERVER_NAME = "ibge-br-mcp";
|
|
3
|
-
export declare const SERVER_VERSION
|
|
3
|
+
export declare const SERVER_VERSION: string;
|
|
4
4
|
/**
|
|
5
5
|
* Builds and configures the IBGE MCP Server with all tools, resources, and
|
|
6
6
|
* prompts registered. Side-effect-free: it does NOT connect a transport, so it
|
|
@@ -10,11 +10,19 @@ export declare const SERVER_VERSION = "3.0.2";
|
|
|
10
10
|
* Statistics) APIs (health data is served via IBGE's SIDRA).
|
|
11
11
|
*/
|
|
12
12
|
export declare function createServer(): McpServer;
|
|
13
|
+
/**
|
|
14
|
+
* Optional per-tool usage hook: called with `tool_call` on every invocation and
|
|
15
|
+
* additionally with `tool_error` when the call fails (error result or throw).
|
|
16
|
+
* The STDIO entry passes nothing; the Cloudflare Worker passes its Durable
|
|
17
|
+
* Object recorder (fire-and-forget telemetry — names and counts only, never
|
|
18
|
+
* tool arguments or results).
|
|
19
|
+
*/
|
|
20
|
+
export type ToolUsageRecorder = (kind: "tool_call" | "tool_error", name: string) => void;
|
|
13
21
|
/**
|
|
14
22
|
* Registers every tool, resource, and prompt onto a given `McpServer`. Kept
|
|
15
23
|
* separate from `createServer` so an alternative transport (e.g. the Cloudflare
|
|
16
24
|
* Worker in `worker/`, which builds its own `McpServer` with hosted metadata)
|
|
17
25
|
* can reuse the exact same registrations.
|
|
18
26
|
*/
|
|
19
|
-
export declare function registerAll(server: McpServer): void;
|
|
27
|
+
export declare function registerAll(server: McpServer, record?: ToolUsageRecorder): void;
|
|
20
28
|
//# sourceMappingURL=server.d.ts.map
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAwB,MAAM,8BAA8B,CAAC;AAoF/E,eAAO,MAAM,WAAW,gBAAgB,CAAC;AACzC,eAAO,MAAM,cAAc,QAAc,CAAC;AAgB1C;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,SAAS,CAOxC;AAED;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,WAAW,GAAG,YAAY,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;AAEzF;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAoyB/E"}
|
package/dist/server.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { McpServer } from "@modelcontextprotocol/
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/server";
|
|
2
|
+
// Version sourced from package.json (single source of truth — avoids drift).
|
|
3
|
+
// Node ESM reads it via the import attribute; esbuild inlines it for the Worker build.
|
|
4
|
+
import pkg from "../package.json" with { type: "json" };
|
|
2
5
|
import { toMcpResult } from "./structured.js";
|
|
3
6
|
import { estadosSchema, estadosOutputSchema, ibgeEstados, municipiosSchema, municipiosOutputSchema, ibgeMunicipios, localidadeSchema, localidadeOutputSchema, ibgeLocalidade, populacaoSchema, populacaoOutputSchema, ibgePopulacao, sidraSchema, sidraOutputSchema, ibgeSidra, nomesSchema, nomesOutputSchema, ibgeNomes, noticiasSchema, noticiasOutputSchema, ibgeNoticias, sidraTabelasSchema, sidraTabelasOutputSchema, ibgeSidraTabelas, sidraMetadadosSchema, sidraMetadadosOutputSchema, ibgeSidraMetadados, malhasSchema, malhasOutputSchema, ibgeMalhas, pesquisasSchema, pesquisasOutputSchema, ibgePesquisas, censoSchema, censoOutputSchema, ibgeCenso,
|
|
4
7
|
// Phase 1 tools (v1.4.0)
|
|
@@ -13,7 +16,7 @@ import { registerResources } from "./resources.js";
|
|
|
13
16
|
import { registerPrompts } from "./prompts.js";
|
|
14
17
|
// Server metadata
|
|
15
18
|
export const SERVER_NAME = "ibge-br-mcp";
|
|
16
|
-
export const SERVER_VERSION =
|
|
19
|
+
export const SERVER_VERSION = pkg.version;
|
|
17
20
|
/**
|
|
18
21
|
* Every tool here is a read-only query against a public REST API: it never
|
|
19
22
|
* mutates state (`readOnlyHint`), repeating a call yields the same effect
|
|
@@ -49,7 +52,22 @@ export function createServer() {
|
|
|
49
52
|
* Worker in `worker/`, which builds its own `McpServer` with hosted metadata)
|
|
50
53
|
* can reuse the exact same registrations.
|
|
51
54
|
*/
|
|
52
|
-
export function registerAll(server) {
|
|
55
|
+
export function registerAll(server, record) {
|
|
56
|
+
/** Wraps a tool impl into the registered handler, instrumented via `record`. */
|
|
57
|
+
const handle = (name, fn) => async (args) => {
|
|
58
|
+
try {
|
|
59
|
+
const result = toMcpResult(await fn(args));
|
|
60
|
+
record?.("tool_call", name);
|
|
61
|
+
if (result.isError === true)
|
|
62
|
+
record?.("tool_error", name);
|
|
63
|
+
return result;
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
record?.("tool_call", name);
|
|
67
|
+
record?.("tool_error", name);
|
|
68
|
+
throw error;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
53
71
|
// Register ibge_estados tool
|
|
54
72
|
server.registerTool("ibge_estados", {
|
|
55
73
|
description: `Lists all Brazilian states from IBGE.
|
|
@@ -69,12 +87,10 @@ Use a different tool when:
|
|
|
69
87
|
- Details/hierarchy of one locality by code → ibge_localidade
|
|
70
88
|
|
|
71
89
|
Behavior: read-only and idempotent — a live GET against the public IBGE Localidades API. Returns a Markdown table.`,
|
|
72
|
-
inputSchema: estadosSchema
|
|
73
|
-
outputSchema: estadosOutputSchema
|
|
90
|
+
inputSchema: estadosSchema,
|
|
91
|
+
outputSchema: estadosOutputSchema,
|
|
74
92
|
annotations: READ_ONLY,
|
|
75
|
-
},
|
|
76
|
-
return toMcpResult(await ibgeEstados(args));
|
|
77
|
-
});
|
|
93
|
+
}, handle("ibge_estados", ibgeEstados));
|
|
78
94
|
// Register ibge_municipios tool
|
|
79
95
|
server.registerTool("ibge_municipios", {
|
|
80
96
|
description: `Lists Brazilian municipalities from IBGE.
|
|
@@ -96,12 +112,10 @@ Use a different tool when:
|
|
|
96
112
|
- Neighboring municipalities → ibge_vizinhos
|
|
97
113
|
|
|
98
114
|
Behavior: read-only and idempotent — a live GET against the public IBGE Localidades API. Returns a Markdown table.`,
|
|
99
|
-
inputSchema: municipiosSchema
|
|
100
|
-
outputSchema: municipiosOutputSchema
|
|
115
|
+
inputSchema: municipiosSchema,
|
|
116
|
+
outputSchema: municipiosOutputSchema,
|
|
101
117
|
annotations: READ_ONLY,
|
|
102
|
-
},
|
|
103
|
-
return toMcpResult(await ibgeMunicipios(args));
|
|
104
|
-
});
|
|
118
|
+
}, handle("ibge_municipios", ibgeMunicipios));
|
|
105
119
|
// Register ibge_localidade tool
|
|
106
120
|
server.registerTool("ibge_localidade", {
|
|
107
121
|
description: `Returns details of a specific locality by IBGE code.
|
|
@@ -123,12 +137,10 @@ Use a different tool when:
|
|
|
123
137
|
- You want to decompose/understand a code's structure → ibge_geocodigo
|
|
124
138
|
|
|
125
139
|
Behavior: read-only and idempotent — a live GET against the public IBGE Localidades API. Returns a Markdown record.`,
|
|
126
|
-
inputSchema: localidadeSchema
|
|
127
|
-
outputSchema: localidadeOutputSchema
|
|
140
|
+
inputSchema: localidadeSchema,
|
|
141
|
+
outputSchema: localidadeOutputSchema,
|
|
128
142
|
annotations: READ_ONLY,
|
|
129
|
-
},
|
|
130
|
-
return toMcpResult(await ibgeLocalidade(args));
|
|
131
|
-
});
|
|
143
|
+
}, handle("ibge_localidade", ibgeLocalidade));
|
|
132
144
|
// Register ibge_populacao tool
|
|
133
145
|
server.registerTool("ibge_populacao", {
|
|
134
146
|
description: `Returns real-time Brazilian population projection.
|
|
@@ -151,12 +163,10 @@ Use a different tool when:
|
|
|
151
163
|
- An arbitrary SIDRA table → ibge_sidra
|
|
152
164
|
|
|
153
165
|
Behavior: read-only and idempotent — a live GET against the public IBGE population-projection API. Returns Markdown plus a typed structuredContent payload.`,
|
|
154
|
-
inputSchema: populacaoSchema
|
|
155
|
-
outputSchema: populacaoOutputSchema
|
|
166
|
+
inputSchema: populacaoSchema,
|
|
167
|
+
outputSchema: populacaoOutputSchema,
|
|
156
168
|
annotations: READ_ONLY,
|
|
157
|
-
},
|
|
158
|
-
return toMcpResult(await ibgePopulacao(args));
|
|
159
|
-
});
|
|
169
|
+
}, handle("ibge_populacao", ibgePopulacao));
|
|
160
170
|
// Register ibge_sidra tool
|
|
161
171
|
server.registerTool("ibge_sidra", {
|
|
162
172
|
description: `Queries SIDRA tables (IBGE's Automatic Recovery System).
|
|
@@ -192,12 +202,10 @@ ibge_sidra is the low-level engine. Prefer a friendlier wrapper when it fits:
|
|
|
192
202
|
Use ibge_sidra_tabelas and ibge_sidra_metadados to find a table code and its structure before querying.
|
|
193
203
|
|
|
194
204
|
Behavior: read-only and idempotent — a live GET against the public IBGE SIDRA API. Returns Markdown plus a typed structuredContent payload.`,
|
|
195
|
-
inputSchema: sidraSchema
|
|
196
|
-
outputSchema: sidraOutputSchema
|
|
205
|
+
inputSchema: sidraSchema,
|
|
206
|
+
outputSchema: sidraOutputSchema,
|
|
197
207
|
annotations: READ_ONLY,
|
|
198
|
-
},
|
|
199
|
-
return toMcpResult(await ibgeSidra(args));
|
|
200
|
-
});
|
|
208
|
+
}, handle("ibge_sidra", ibgeSidra));
|
|
201
209
|
// Register ibge_nomes tool
|
|
202
210
|
server.registerTool("ibge_nomes", {
|
|
203
211
|
description: `Queries name frequency and rankings in Brazil (IBGE).
|
|
@@ -221,12 +229,10 @@ Examples:
|
|
|
221
229
|
- Female names: tipo="ranking", sexo="F"
|
|
222
230
|
|
|
223
231
|
Behavior: read-only and idempotent — a live GET against the public IBGE Nomes (Censo) API. Returns a Markdown table.`,
|
|
224
|
-
inputSchema: nomesSchema
|
|
225
|
-
outputSchema: nomesOutputSchema
|
|
232
|
+
inputSchema: nomesSchema,
|
|
233
|
+
outputSchema: nomesOutputSchema,
|
|
226
234
|
annotations: READ_ONLY,
|
|
227
|
-
},
|
|
228
|
-
return toMcpResult(await ibgeNomes(args));
|
|
229
|
-
});
|
|
235
|
+
}, handle("ibge_nomes", ibgeNomes));
|
|
230
236
|
// Register ibge_noticias tool
|
|
231
237
|
server.registerTool("ibge_noticias", {
|
|
232
238
|
description: `Searches and lists already-published IBGE news articles and press releases.
|
|
@@ -252,12 +258,10 @@ Use a different tool when:
|
|
|
252
258
|
- Scheduled/upcoming release dates (not yet published) → ibge_calendario
|
|
253
259
|
|
|
254
260
|
Behavior: read-only and idempotent — a live GET against the public IBGE Notícias API. Returns a Markdown list.`,
|
|
255
|
-
inputSchema: noticiasSchema
|
|
256
|
-
outputSchema: noticiasOutputSchema
|
|
261
|
+
inputSchema: noticiasSchema,
|
|
262
|
+
outputSchema: noticiasOutputSchema,
|
|
257
263
|
annotations: READ_ONLY,
|
|
258
|
-
},
|
|
259
|
-
return toMcpResult(await ibgeNoticias(args));
|
|
260
|
-
});
|
|
264
|
+
}, handle("ibge_noticias", ibgeNoticias));
|
|
261
265
|
// Register ibge_sidra_tabelas tool
|
|
262
266
|
server.registerTool("ibge_sidra_tabelas", {
|
|
263
267
|
description: `Lists and searches available SIDRA tables.
|
|
@@ -284,12 +288,10 @@ This is step 1 of the SIDRA workflow: find a table code → ibge_sidra_metadados
|
|
|
284
288
|
For common data, a wrapper is usually easier: ibge_censo, ibge_indicadores, ibge_comparar, ibge_cidades.
|
|
285
289
|
|
|
286
290
|
Behavior: read-only and idempotent — a live GET against the public IBGE SIDRA API. Returns a Markdown table.`,
|
|
287
|
-
inputSchema: sidraTabelasSchema
|
|
288
|
-
outputSchema: sidraTabelasOutputSchema
|
|
291
|
+
inputSchema: sidraTabelasSchema,
|
|
292
|
+
outputSchema: sidraTabelasOutputSchema,
|
|
289
293
|
annotations: READ_ONLY,
|
|
290
|
-
},
|
|
291
|
-
return toMcpResult(await ibgeSidraTabelas(args));
|
|
292
|
-
});
|
|
294
|
+
}, handle("ibge_sidra_tabelas", ibgeSidraTabelas));
|
|
293
295
|
// Register ibge_sidra_metadados tool
|
|
294
296
|
server.registerTool("ibge_sidra_metadados", {
|
|
295
297
|
description: `Returns metadata for a specific SIDRA table.
|
|
@@ -311,12 +313,10 @@ Examples:
|
|
|
311
313
|
Use this after finding a table code (ibge_sidra_tabelas) and before querying with ibge_sidra.
|
|
312
314
|
|
|
313
315
|
Behavior: read-only and idempotent — a live GET against the public IBGE SIDRA API. Returns Markdown.`,
|
|
314
|
-
inputSchema: sidraMetadadosSchema
|
|
315
|
-
outputSchema: sidraMetadadosOutputSchema
|
|
316
|
+
inputSchema: sidraMetadadosSchema,
|
|
317
|
+
outputSchema: sidraMetadadosOutputSchema,
|
|
316
318
|
annotations: READ_ONLY,
|
|
317
|
-
},
|
|
318
|
-
return toMcpResult(await ibgeSidraMetadados(args));
|
|
319
|
-
});
|
|
319
|
+
}, handle("ibge_sidra_metadados", ibgeSidraMetadados));
|
|
320
320
|
// Register ibge_malhas tool
|
|
321
321
|
server.registerTool("ibge_malhas", {
|
|
322
322
|
description: `Gets geographic meshes (maps) from IBGE in GeoJSON, TopoJSON, or SVG format.
|
|
@@ -347,12 +347,10 @@ Use a different tool when:
|
|
|
347
347
|
- Thematic meshes (biomes, Legal Amazon, semi-arid, metropolitan regions) → ibge_malhas_tema
|
|
348
348
|
|
|
349
349
|
Behavior: read-only and idempotent — a live GET against the public IBGE Malhas API. Returns the mesh in the requested format (GeoJSON, TopoJSON, or SVG).`,
|
|
350
|
-
inputSchema: malhasSchema
|
|
351
|
-
outputSchema: malhasOutputSchema
|
|
350
|
+
inputSchema: malhasSchema,
|
|
351
|
+
outputSchema: malhasOutputSchema,
|
|
352
352
|
annotations: READ_ONLY,
|
|
353
|
-
},
|
|
354
|
-
return toMcpResult(await ibgeMalhas(args));
|
|
355
|
-
});
|
|
353
|
+
}, handle("ibge_malhas", ibgeMalhas));
|
|
356
354
|
// Register ibge_pesquisas tool
|
|
357
355
|
server.registerTool("ibge_pesquisas", {
|
|
358
356
|
description: `Lists available IBGE surveys and their tables.
|
|
@@ -378,12 +376,10 @@ Examples:
|
|
|
378
376
|
This lists surveys, not data. To find table codes use ibge_sidra_tabelas; to query data use ibge_sidra (or a wrapper: ibge_censo, ibge_indicadores, ibge_comparar, ibge_cidades).
|
|
379
377
|
|
|
380
378
|
Behavior: read-only and idempotent — a live GET against the public IBGE SIDRA/Pesquisas API. Returns a Markdown list.`,
|
|
381
|
-
inputSchema: pesquisasSchema
|
|
382
|
-
outputSchema: pesquisasOutputSchema
|
|
379
|
+
inputSchema: pesquisasSchema,
|
|
380
|
+
outputSchema: pesquisasOutputSchema,
|
|
383
381
|
annotations: READ_ONLY,
|
|
384
|
-
},
|
|
385
|
-
return toMcpResult(await ibgePesquisas(args));
|
|
386
|
-
});
|
|
382
|
+
}, handle("ibge_pesquisas", ibgePesquisas));
|
|
387
383
|
// Register ibge_censo tool
|
|
388
384
|
server.registerTool("ibge_censo", {
|
|
389
385
|
description: `Queries IBGE Demographic Census data (1970-2022).
|
|
@@ -416,12 +412,10 @@ Use a different tool when:
|
|
|
416
412
|
- An arbitrary SIDRA table → ibge_sidra
|
|
417
413
|
|
|
418
414
|
Behavior: read-only and idempotent — a live GET against the public IBGE SIDRA API. Returns Markdown plus a typed structuredContent payload.`,
|
|
419
|
-
inputSchema: censoSchema
|
|
420
|
-
outputSchema: censoOutputSchema
|
|
415
|
+
inputSchema: censoSchema,
|
|
416
|
+
outputSchema: censoOutputSchema,
|
|
421
417
|
annotations: READ_ONLY,
|
|
422
|
-
},
|
|
423
|
-
return toMcpResult(await ibgeCenso(args));
|
|
424
|
-
});
|
|
418
|
+
}, handle("ibge_censo", ibgeCenso));
|
|
425
419
|
// Register ibge_indicadores tool (Phase 1)
|
|
426
420
|
server.registerTool("ibge_indicadores", {
|
|
427
421
|
description: `Queries IBGE economic and social indicators.
|
|
@@ -463,12 +457,10 @@ Use a different tool when:
|
|
|
463
457
|
- One municipality's panel → ibge_cidades
|
|
464
458
|
|
|
465
459
|
Behavior: read-only and idempotent — a live GET against the public IBGE SIDRA API. Returns Markdown plus a typed structuredContent payload.`,
|
|
466
|
-
inputSchema: indicadoresSchema
|
|
467
|
-
outputSchema: indicadoresOutputSchema
|
|
460
|
+
inputSchema: indicadoresSchema,
|
|
461
|
+
outputSchema: indicadoresOutputSchema,
|
|
468
462
|
annotations: READ_ONLY,
|
|
469
|
-
},
|
|
470
|
-
return toMcpResult(await ibgeIndicadores(args));
|
|
471
|
-
});
|
|
463
|
+
}, handle("ibge_indicadores", ibgeIndicadores));
|
|
472
464
|
// Register ibge_cnae tool (Phase 1)
|
|
473
465
|
server.registerTool("ibge_cnae", {
|
|
474
466
|
description: `Queries CNAE (National Classification of Economic Activities) from IBGE.
|
|
@@ -495,12 +487,10 @@ Examples:
|
|
|
495
487
|
- List divisions: nivel="divisoes"
|
|
496
488
|
|
|
497
489
|
Behavior: read-only and idempotent — a live GET against the public IBGE CNAE API. Returns Markdown.`,
|
|
498
|
-
inputSchema: cnaeSchema
|
|
499
|
-
outputSchema: cnaeOutputSchema
|
|
490
|
+
inputSchema: cnaeSchema,
|
|
491
|
+
outputSchema: cnaeOutputSchema,
|
|
500
492
|
annotations: READ_ONLY,
|
|
501
|
-
},
|
|
502
|
-
return toMcpResult(await ibgeCnae(args));
|
|
503
|
-
});
|
|
493
|
+
}, handle("ibge_cnae", ibgeCnae));
|
|
504
494
|
// Register ibge_geocodigo tool (Phase 1)
|
|
505
495
|
server.registerTool("ibge_geocodigo", {
|
|
506
496
|
description: `Decodes IBGE codes or searches codes by locality name.
|
|
@@ -529,12 +519,10 @@ Use a different tool when:
|
|
|
529
519
|
- You want the full detailed record of one locality → ibge_localidade
|
|
530
520
|
|
|
531
521
|
Behavior: read-only and idempotent — a live GET against the public IBGE Localidades API. Returns Markdown.`,
|
|
532
|
-
inputSchema: geocodigoSchema
|
|
533
|
-
outputSchema: geocodigoOutputSchema
|
|
522
|
+
inputSchema: geocodigoSchema,
|
|
523
|
+
outputSchema: geocodigoOutputSchema,
|
|
534
524
|
annotations: READ_ONLY,
|
|
535
|
-
},
|
|
536
|
-
return toMcpResult(await ibgeGeocodigo(args));
|
|
537
|
-
});
|
|
525
|
+
}, handle("ibge_geocodigo", ibgeGeocodigo));
|
|
538
526
|
// Register ibge_calendario tool (Phase 2)
|
|
539
527
|
server.registerTool("ibge_calendario", {
|
|
540
528
|
description: `Queries IBGE release and collection calendar.
|
|
@@ -559,12 +547,10 @@ Use a different tool when:
|
|
|
559
547
|
- Already-published news and releases → ibge_noticias
|
|
560
548
|
|
|
561
549
|
Behavior: read-only and idempotent — a live GET against the public IBGE Calendário API. Returns a Markdown list.`,
|
|
562
|
-
inputSchema: calendarioSchema
|
|
563
|
-
outputSchema: calendarioOutputSchema
|
|
550
|
+
inputSchema: calendarioSchema,
|
|
551
|
+
outputSchema: calendarioOutputSchema,
|
|
564
552
|
annotations: READ_ONLY,
|
|
565
|
-
},
|
|
566
|
-
return toMcpResult(await ibgeCalendario(args));
|
|
567
|
-
});
|
|
553
|
+
}, handle("ibge_calendario", ibgeCalendario));
|
|
568
554
|
// Register ibge_comparar tool (Phase 2)
|
|
569
555
|
server.registerTool("ibge_comparar", {
|
|
570
556
|
description: `Compares data between localities (municipalities or states).
|
|
@@ -594,12 +580,10 @@ Use this tool ONLY to rank/compare 2–10 localities on one indicator.
|
|
|
594
580
|
For a single locality, use ibge_cidades (municipal panel), ibge_censo, or ibge_sidra.
|
|
595
581
|
|
|
596
582
|
Behavior: read-only and idempotent — a live GET against the public IBGE APIs (SIDRA and Localidades). Returns Markdown plus a typed structuredContent payload.`,
|
|
597
|
-
inputSchema: compararSchema
|
|
598
|
-
outputSchema: compararOutputSchema
|
|
583
|
+
inputSchema: compararSchema,
|
|
584
|
+
outputSchema: compararOutputSchema,
|
|
599
585
|
annotations: READ_ONLY,
|
|
600
|
-
},
|
|
601
|
-
return toMcpResult(await ibgeComparar(args));
|
|
602
|
-
});
|
|
586
|
+
}, handle("ibge_comparar", ibgeComparar));
|
|
603
587
|
// Register ibge_malhas_tema tool (Phase 3)
|
|
604
588
|
server.registerTool("ibge_malhas_tema", {
|
|
605
589
|
description: `Gets thematic geographic meshes from IBGE.
|
|
@@ -633,12 +617,10 @@ Use a different tool when:
|
|
|
633
617
|
- Administrative meshes (Brazil/region/state/municipality outlines) → ibge_malhas
|
|
634
618
|
|
|
635
619
|
Behavior: read-only and idempotent — a live GET against the public IBGE Malhas API. Returns the mesh in the requested format (GeoJSON, TopoJSON, or SVG).`,
|
|
636
|
-
inputSchema: malhasTemaSchema
|
|
637
|
-
outputSchema: malhasTemaOutputSchema
|
|
620
|
+
inputSchema: malhasTemaSchema,
|
|
621
|
+
outputSchema: malhasTemaOutputSchema,
|
|
638
622
|
annotations: READ_ONLY,
|
|
639
|
-
},
|
|
640
|
-
return toMcpResult(await ibgeMalhasTema(args));
|
|
641
|
-
});
|
|
623
|
+
}, handle("ibge_malhas_tema", ibgeMalhasTema));
|
|
642
624
|
// Register ibge_vizinhos tool (Phase 3)
|
|
643
625
|
server.registerTool("ibge_vizinhos", {
|
|
644
626
|
description: `Finds nearby/neighboring municipalities.
|
|
@@ -660,12 +642,10 @@ Note: proximity is approximated by shared mesoregion (not exact spatial adjacenc
|
|
|
660
642
|
For listing/searching municipalities, use ibge_municipios.
|
|
661
643
|
|
|
662
644
|
Behavior: read-only and idempotent — a live GET against the public IBGE Localidades API. Returns a Markdown list.`,
|
|
663
|
-
inputSchema: vizinhosSchema
|
|
664
|
-
outputSchema: vizinhosOutputSchema
|
|
645
|
+
inputSchema: vizinhosSchema,
|
|
646
|
+
outputSchema: vizinhosOutputSchema,
|
|
665
647
|
annotations: READ_ONLY,
|
|
666
|
-
},
|
|
667
|
-
return toMcpResult(await ibgeVizinhos(args));
|
|
668
|
-
});
|
|
648
|
+
}, handle("ibge_vizinhos", ibgeVizinhos));
|
|
669
649
|
// Register ibge_datasaude tool (Phase 3)
|
|
670
650
|
server.registerTool("ibge_datasaude", {
|
|
671
651
|
description: `Queries Brazil health indicators, served through IBGE's SIDRA (some originally produced by DataSUS, e.g. mortality and births).
|
|
@@ -701,12 +681,10 @@ Use a different tool when:
|
|
|
701
681
|
- Population/demographic counts (not health-specific) → ibge_censo or ibge_sidra
|
|
702
682
|
|
|
703
683
|
Behavior: read-only and idempotent — a live GET against the public IBGE SIDRA API. Returns Markdown plus a typed structuredContent payload.`,
|
|
704
|
-
inputSchema: datasaudeSchema
|
|
705
|
-
outputSchema: datasaudeOutputSchema
|
|
684
|
+
inputSchema: datasaudeSchema,
|
|
685
|
+
outputSchema: datasaudeOutputSchema,
|
|
706
686
|
annotations: READ_ONLY,
|
|
707
|
-
},
|
|
708
|
-
return toMcpResult(await ibgeDatasaude(args));
|
|
709
|
-
});
|
|
687
|
+
}, handle("ibge_datasaude", ibgeDatasaude));
|
|
710
688
|
// Register ibge_paises tool (Phase 4)
|
|
711
689
|
server.registerTool("ibge_paises", {
|
|
712
690
|
description: `Queries international country data via IBGE.
|
|
@@ -729,12 +707,10 @@ Examples:
|
|
|
729
707
|
- Available indicators: tipo="indicadores"
|
|
730
708
|
|
|
731
709
|
Behavior: read-only and idempotent — a live GET against the public IBGE Países API. Returns Markdown.`,
|
|
732
|
-
inputSchema: paisesSchema
|
|
733
|
-
outputSchema: paisesOutputSchema
|
|
710
|
+
inputSchema: paisesSchema,
|
|
711
|
+
outputSchema: paisesOutputSchema,
|
|
734
712
|
annotations: READ_ONLY,
|
|
735
|
-
},
|
|
736
|
-
return toMcpResult(await ibgePaises(args));
|
|
737
|
-
});
|
|
713
|
+
}, handle("ibge_paises", ibgePaises));
|
|
738
714
|
// Register ibge_cidades tool (Phase 4)
|
|
739
715
|
server.registerTool("ibge_cidades", {
|
|
740
716
|
description: `Queries municipal indicators from IBGE (similar to Cidades@ portal).
|
|
@@ -762,12 +738,10 @@ Use a different tool when:
|
|
|
762
738
|
- A macro indicator time series → ibge_indicadores
|
|
763
739
|
|
|
764
740
|
Behavior: read-only and idempotent — a live GET against the public IBGE APIs (Cidades@/agregados). Returns Markdown plus a typed structuredContent payload.`,
|
|
765
|
-
inputSchema: cidadesSchema
|
|
766
|
-
outputSchema: cidadesOutputSchema
|
|
741
|
+
inputSchema: cidadesSchema,
|
|
742
|
+
outputSchema: cidadesOutputSchema,
|
|
767
743
|
annotations: READ_ONLY,
|
|
768
|
-
},
|
|
769
|
-
return toMcpResult(await ibgeCidades(args));
|
|
770
|
-
});
|
|
744
|
+
}, handle("ibge_cidades", ibgeCidades));
|
|
771
745
|
// Reference catalogs (roadmap 1.6) and analysis templates
|
|
772
746
|
registerResources(server);
|
|
773
747
|
registerPrompts(server);
|