Skip to main content
Glama
opedrosoares

MCP Compras.gov.br

by opedrosoares

compras_arp_buscar_por_objeto

Search active procurement registration records (ARPs) by keyword in the object description, filtering by validity date range. Returns matching ARPs with pagination limits to avoid upstream API constraints.

Instructions

Busca ARPs vigentes cujo objeto contém uma palavra-chave.

Resolve a limitação do endpoint /modulo-arp/1.2_consultarARP_FimVigencia, que não aceita filtro por texto: pagina internamente até max_paginas_varridas e filtra client-side por presença de palavra_chave (case-insensitive, com normalização de acentos). Curto-circuita quando atinge max_resultados.

O servidor faz o trabalho que antes era pedido ao LLM — sem isso, o roteiro oportunidades_carona_arp esbarrava em 169k ARPs vigentes e 339 páginas. Achado da bateria A v0.3.5.

Limitação conhecida: o schema upstream de ARP não traz UF no item — só nomeOrgao e nomeUnidadeGerenciadora. Para filtrar por UF, cruze os matches com compras_uasg_consultar usando codigoUnidadeGerenciadora e compare unidade.uf. Não tentamos esse cruzamento aqui para manter a tool barata e previsível.

Output: { "resultado": [], "total_examinadas": int, "matches": int, "paginas_varridas": int, "curto_circuitou": bool, "_filtro_objeto": {...} }

Cache 15 min por (palavra_chave + janela + caps).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
palavra_chaveYesTermo a procurar no campo `objetoCompra` das ARPs (case-insensitive, com normalização básica de acentos). Exemplos: 'notebook', 'uniformes', 'limpeza'.
max_resultadosNoQuantos matches no máximo retornar (curto-circuita a varredura).
max_paginas_varridasNoQuantas páginas do upstream serão varridas para encontrar matches (proteção de latência). Default 10 × 500 itens = até 5.000 ARPs examinadas. Cap em 50.
data_vigencia_final_maxYesLimite máximo do fim de vigência (YYYY-MM-DD).
data_vigencia_final_minYesLimite mínimo do fim de vigência (YYYY-MM-DD). Tipicamente hoje para 'apenas vigentes'.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

The description thoroughly discloses internal behavior: client-side filtering, pagination up to 'max_paginas_varridas', curto-circuit on 'max_resultados', case-insensitive matching with accent normalization, and a known limitation about missing UF field. With no annotations provided, the description carries the full burden and does an excellent job. It loses one point only because it doesn't document whether the operation has any side effects (though likely read-only).

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: purpose, technical context, limitation, output format. It uses Portuguese throughout and is efficient, but could drop the internal note about 'Achado da bateria A v0.3.5' which is meta-information not useful for an agent. Each section earns its place; the text is front-loaded with purpose.

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 tool with 5 parameters, 100% schema coverage, and an output schema, the description is remarkably complete. It explains the problem it solves, limits, downstream implications, and even provides an alternative tool chain for UF filtering. The caching policy and return structure are documented. Nothing essential is missing.

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 baseline is 3. However, the description adds significant value beyond the schema: it explains the relationship between parameters ('max_resultados' and 'max_paginas_varridas' act as limits), the rationale for defaults (5000 ARPs examined with default pagination), and the caching key ('palavra_chave + janela + caps'). The description also provides examples for 'palavra_chave' and context for 'data_vigencia_final_min' (typically today for vigentes). This is above baseline.

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 the tool searches for active ARPs (Atas de Registro de Preços) whose 'objeto' contains a keyword. It names a specific verb 'Busca' and resource 'ARPs vigentes', and distinguishes itself from the sibling 'compras_arp_por_fim_vigencia' by explaining this tool solves the limitation of that endpoint not accepting text filters.

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 context on when to use this tool versus alternatives. It identifies the upstream limitation of '/modulo-arp/1.2_consultarARP_FimVigencia', documents internal pagination behavior, and includes a specific limitation about UF not being in the upstream schema, offering an alternative workflow with 'compras_uasg_consultar'. It also mentions caching policy.

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