Skip to main content
Glama
opedrosoares

MCP Compras.gov.br

by opedrosoares

compras_pncp_orgao_unidades

List administrative units of a Brazilian government agency using its CNPJ to obtain unit codes for filtering procurement and contract data.

Instructions

Lista unidades administrativas de um órgão no PNCP.

Endpoint PNCP /v1/orgaos/{cnpj}/unidades. Útil para descobrir códigos de unidade antes de filtrar contratações/contratos do órgão.

Cobre estados e municípios (não só federal). Cache 24h.

Tratamento de 404: nem todo CNPJ está indexado no PNCP. Em vez de levantar exception, esta tool retorna _erro_upstream informativo com lista de alternativas (mesmo padrão das tools compras_uasg_* / compras_orgao_* quando o /modulo-uasg/* retorna 404).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cnpjYesCNPJ do órgão (14 dígitos, com ou sem pontuação). Exemplo: 00394460000141 (Presidência da República).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

The description discloses multiple behavioral traits: cache of 24 hours and specific 404 error handling that returns a structured error object instead of throwing an exception, including a reference to consistent patterns in sibling tools. No annotations exist, so the description carries full burden and does so thoroughly.

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 short but packed with essential information: what it does, the endpoint, when to use it, caching policy, and special behavior. Every sentence is valuable and front-loaded with the core action.

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 tool has a single required parameter, no annotations, and an output schema (so return format is covered), the description fully covers the tool's purpose, usage context, caching behavior, and error handling. There is no missing information relevant to an agent deciding to call this tool.

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?

There is only one parameter (cnpj), and the description adds meaning beyond the schema by stating it is a 14-digit CNPJ (with or without punctuation) and provides an example. However, since schema coverage is already 100% and the parameter is simple, the description does not add substantial extra nuance beyond the example.

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 lists administrative units of a government agency (órgão) in the PNCP system. It specifies the endpoint, identifies its purpose (discovering unit codes before filtering contracts), and distinguishes it from the many sibling tools by mentioning the specific context of PNCP agencies.

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 explains the tool is useful before filtering contracts by unit, and covers states and municipalities (not just federal), giving context on when to use it. It does not explicitly exclude other scenarios or provide at-length when-not-to-use guidance, but the use case is clear enough without needing to list all alternatives.

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