Skip to main content
Glama
opedrosoares

MCP Compras.gov.br

by opedrosoares

compras_uasg_buscar

Search for UASG (procurement unit) records by partial name, with local filtering, accent-insensitive matching, and paginated results. Returns matching units even when the upstream API lacks text search filters.

Instructions

Busca UASGs por trecho do nome (match parcial, ignora acento e caixa).

✅ Restaurada em 2026-08-05, com busca local. Duas correções:

  1. A rota exige statusUasg; sem ele devolvia 404 (mesma causa de compras_uasg_listar).

  2. O parâmetro nome não existe no contrato da rota e era ignorado pelo upstream — enviá-lo devolvia o universo inteiro (~22 mil UASGs) como se fossem resultados de busca. Corrigir só o item 1 teria trocado um erro visível (404) por um erro silencioso, que é pior: o analista receberia "TCU - SECRETARIA DE INFORMATICA" como 1º resultado de qualquer termo.

Como não há filtro textual upstream, a busca é feita localmente: a tool varre as páginas da rota (500 registros cada, ~8s no universo completo), filtra por termo e pagina o resultado filtrado. O varrido fica em cache por 24h, então só a primeira busca do dia paga o custo.

O payload informa _busca_local, _paginas_varridas e _universo_varrido — se a varredura for truncada, isso fica explícito em vez de virar silêncio.

Cache 24h.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
termoYesTrecho do nome da UASG (match literal, ignora acento e caixa). Ex.: 'aquaviarios', 'tribunal regional', 'exercito'. Siglas raramente funcionam — os nomes vêm por extenso no cadastro ('AGÊNCIA NACIONAL DE TRANSPORTES AQUAVIÁRIOS', não 'ANTAQ').
paginaNoPágina de resultados (1-based). Padrão 1.
tamanho_paginaNoQuantidade de registros por página. Padrão 50, máximo 500.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

The description fully discloses behavioral traits beyond annotations (none provided). It details caching (24h), upstream limitations (no textual filter, requires statusUasg), the local filtering approach, pagination logic (fetches pages until matching or truncation), and explicit response markers to indicate truncation. This is exemplary transparency for a tool that works around upstream constraints.

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 detailed and well-structured, with a clear title line followed by a changelog/context section. The bullet for the 'nome' parameter issue is helpful but slightly verbose. Every sentence adds value, but the changelog-style update note could be slightly more concise. Overall, it's well-organized and front-loaded with the core functionality.

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?

Given the output schema exists, the description doesn't need to explain return values. The tool is moderately complex (3 parameters, local search workaround with caching and pagination), and the description covers its behavior comprehensively: when the upstream returns 404, why the nome parameter was problematic, how local search works, caching TTL, and response markers. This leaves an agent fully equipped to use the tool correctly without surprises.

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

Parameters5/5

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

The input schema already has 100% description coverage (all three parameters have descriptions). The tool description adds minimal extra info beyond the schema (e.g., the update note about caching and upstream issues), but the schema descriptions are themselves comprehensive: termo explains match type, character limits, and gives examples; pagina explains 1-based indexing; tamanho_pagina explains default and max. The description and schema together provide full parameter understanding.

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 'Busca UASGs por trecho do nome' (search UASGs by name fragment), specifying it uses partial match, ignores accents and case. This uniquely distinguishes it from siblings like 'compras_uasg_listar' (lists) and 'compras_uasg_consultar' (detailed query). The description explicitly notes the match is literal and mentions example terms, leaving no ambiguity about the tool's core function.

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 explicitly explains when and how to use this tool: it performs local search because the upstream API has no textual filter. It warns that sending a nome parameter to the upstream would return the entire universe (22k UASGs) as false matches. It clarifies the polling behavior (500 records per page, ~8s full scan, 24h cache), so users know only the first daily query pays the cost. It also tells that the response contains _busca_local, _paginas_varridas, and _universo_varrido markers. No sibling is a direct alternative for name-based search, so the tool's distinct use case is clear.

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