Skip to main content
Glama
opedrosoares

MCP Compras.gov.br

by opedrosoares

compras_aggregate_contratacoes_por_periodo

Read-onlyIdempotent

Aggregate Brazilian procurement contracts by day, week, month, or year; count records or sum estimated/awarded values within a date range and modality.

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

Schema Changelog

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

  1. First observedv0.3.14

TDQS

A4.2/5.0
Behavior5/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, but the description adds significant behavioral detail: count mode makes one call per bucket reading only totalRegistros, value modes paginate up to 25 pages/12,500 records per bucket and signal truncado=true, internal concurrency is 4 calls, and cache is 30 minutes.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact, front-loaded with the core purpose, and organized into bolded mode sections followed by a one-line concurrency/cache note. Every sentence adds information; there is no filler or redundant repetition of schema fields.

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?

With an output schema present, return-value documentation is not required. The description covers mode selection, performance expectations, pagination limits, truncation signaling, concurrency, and cache behavior, giving an agent everything needed to call the tool correctly and anticipate its costs.

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 coverage is 100%, giving a baseline of 3. The description adds meaning beyond the schema by explaining metrica modes (count reads totalRegistros, value modes sum pages), the esfera filter's effect only in value mode, and the practical impact of MAX_PAGES_PER_BUCKET and truncado.

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 opens with 'Série temporal de contratações no PNCP por bucket', clearly indicating a time-series aggregation over contracting data. It conveys the operation and resource, and the bucketing concept distinguishes it from simple list/consult tools, though it does not explicitly contrast with any named sibling.

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

Usage Guidelines3/5

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

The description provides internal mode guidance: count is recommended for trend analysis, value modes are slower and should only be used when necessary, and page limits/truncation are warned. However, it does not state when to use this tool versus sibling alternatives such as compras_comparar_periodos_contratacoes or compras_indicadores_por_periodo.

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