Skip to main content
Glama
opedrosoares

MCP Compras.gov.br

by opedrosoares

compras_pesquisar_preco_material

Retrieve unit prices for materials from Brazilian government purchases using CATMAT code. Filter by date, location, or buyer UASG to support price research.

Instructions

Pesquisa preços praticados em compras de material (CATMAT) pelo governo.

Endpoint Dados Abertos: /modulo-pesquisa-preco/1_consultarMaterial. Para visão consolidada estatística (média/mediana no padrão IN 65/2021), use a tool composta compras_pesquisar_precos_para_etp.

Cada item da resposta traz precoUnitario, quantidade, dataCompra, niFornecedor/nomeFornecedor e a UASG compradora — é esta a tool que devolve valor unitário para material. A compras_detalhar_preco_material NÃO devolve preço (ver a docstring dela).

⚠️ Quebra upstream corrigida em 2026-08-05: entre ~2026-07 e 2026-08-05 esta tool respondia "Recurso nao encontrado" (HTTP 404). A SEGES trocou a assinatura de query da rota sem versionar: o parâmetro codigoItemCatalogo foi substituído pelo par tipo (enum codigoItemCatalogo | codigoPdm) + codigo. Como a API responde 404 — e não 400 — a parâmetros obrigatórios ausentes, a quebra se disfarçou de "rota removida". A rota nunca saiu do swagger oficial. Corrigido na v0.3.13; a assinatura de compras_pesquisar_preco_servico (rota 3) não mudou.

Se voltar a devolver 404, a tool não levanta exception: devolve _erro_upstream com diagnóstico e alternativas.

Cache 10 min.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ufNoSigla da UF (ex.: 'DF'). Filtra compras realizadas pelo órgão da UF.
paginaNoPágina (1-based).
data_fimNoData final da compra (YYYY-MM-DD). Quando omitida, a API usa a data atual.
codigo_uasgNoCódigo da UASG compradora (filtro mais específico ainda).
data_inicioNoData inicial da compra (YYYY-MM-DD). Quando omitida, a API usa o início do ano corrente.
tamanho_paginaNoRegistros por página.
codigo_municipioNoCódigo IBGE do município (7 dígitos). Filtro mais fino que UF.
codigo_item_catalogoYesCódigo CATMAT do material. Inteiro 4-8 dígitos. Ex.: 460789.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

The description is exceptionally transparent: it documents a past upstream breaking change, explaining the root cause (API signature change without versioning), the misleading HTTP 404 behavior, and the resolution date. It also clarifies that upon new 404 errors, the tool returns an error diagnostic rather than raising an exception. With no annotations provided, this description carries the full burden and does so admirably, though it loses one point for not explicitly stating the read-only nature or response structure.

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 well-structured and front-loaded: the first paragraph states the core purpose and endpoint; the second clarifies sibling differentiation; the third and fourth provide a critical behavioral note with historical context. Every sentence adds value, and the total length is justified by the tool's complexity.

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?

This tool has 8 parameters, no annotations, but a complete output schema. The description compensates fully for the missing annotations: it covers behavioral traits (upstream break, error handling), usage context, and sibling differentiation. There is no significant gap given the tool's complexity and available structured data.

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 description coverage is 100%, so the schema already documents all parameters clearly (e.g., codigo_item_catalogo as CATMAT code, uf as state acronym). The description restates that each response includes fields like precoUnitario and fornecedor info, but adds no new semantic detail beyond the schema's exhaustive descriptions. Baseline 3 is appropriate.

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?

The description clearly states that this tool queries prices paid by the government for material purchases (CATMAT), using a specific open data endpoint. It explicitly distinguishes itself from sibling tools like `compras_pesquisar_precos_para_etp` (statistical view) and `compras_detalhar_preco_material` (doesn't return unit price), making its unique purpose unmistakable.

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?

The description provides explicit guidance: use this tool for per-material unit prices, and directs users to `compras_pesquisar_precos_para_etp` for statistical aggregates per IN 65/2021. It also warns that `compras_detalhar_preco_material` does not return prices, preventing misuse.

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