Skip to main content
Glama
opedrosoares

MCP Compras.gov.br

by opedrosoares

compras_aggregate_contratacoes_por_periodo

Aggregates Brazilian government procurement contracts over time. Counts contracts or sums estimated/homologated values, filtered by modality, UF, and sphere.

Instructions

Série temporal de contratações no PNCP por bucket.

Modo count (recomendado para tendência): 1 chamada por bucket lendo apenas totalRegistros. Janelas grandes (até 5 anos) são viáveis.

Modo valor_*: varre todas as páginas de cada bucket para somar. Mais lento; limita-se a MAX_PAGES_PER_BUCKET=25 páginas (× 500 itens = 12.500 registros máx por bucket). Sinaliza truncado=true quando bate o teto.

Concurrency interna: 4 calls simultâneas. Cache 30 min.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ufNoUF opcional.
esferaNoFiltro de esfera (federal/estadual/municipal/distrital). Só tem efeito no modo 'valor_*' (precisa varrer páginas).
metricaNoMétrica a calcular: 'count' (rápido, 1 call por bucket), 'valor_estimado' ou 'valor_homologado' (paginado, mais lento). Use 'count' para tendência pura; só ative valores quando necessário.count
data_finalYesData final da janela de agregação (YYYY-MM-DD).
data_inicialYesData inicial da janela de agregação (YYYY-MM-DD).
granularidadeNoTamanho de cada bucket da série: 'dia', 'semana', 'mes' ou 'ano'.mes
codigo_modalidadeYesModalidade PNCP a agregar. Comuns: 6=Pregão Eletrônico, 8=Dispensa, 9=Inexigibilidade, 4=Concorrência Eletrônica.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

The description clearly explains the behavioral differences between count mode (fast, one call) and valor_* mode (pagination, slower, truncation). It even names the internal concurrency (4 calls) and cache duration (30 min). Since no annotations were provided, the description properly carries this burden.

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 well-structured with clear sections, uses bold for emphasis, and each sentence serves a purpose. It could be slightly more concise by removing the 'Concurrency interna' line which is an implementation detail, but is otherwise efficient.

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

Completeness4/5

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

Given the tool's moderate complexity (7 parameters, 2 modes, pagination) and the presence of an output schema, the description covers key behaviors, modes, limits, and constraints. It does not explain the return value format for count mode versus valor_* mode, but the output schema presumably handles that.

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

Parameters3/5

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

Schema coverage is 100%, so the description primarily adds context for the metrica and granularidade parameters (recommending count for trends, explaining bucket sizes). The overall parameter documentation is already complete in the schema, so the description provides marginal but useful nuance.

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

Purpose4/5

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

The description clearly states this tool produces a time series of hiring data (contratações) aggregated by time buckets. However, it does not explicitly differentiate itself from the many sibling tools that also query contracting data, such as compras_contratacoes_14133_listar or compras_indicadores_consolidados, which may have overlapping purposes.

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?

The description provides direct guidance on when to use count vs valor_* modes, including performance implications and page limits. It does not, however, explicitly state when to prefer this tool over siblings like compras_indicadores_por_periodo or compras_contratacoes_14133_listar for time-series queries.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/opedrosoares/MCP_Compras'

If you have feedback or need assistance with the MCP directory API, please join our Discord server