Skip to main content
Glama
lucaspmgomess

querido-diario-mcp-server

search_gazettes

Search the full text of Brazilian municipal official gazettes using keywords, city filters, and date ranges to locate specific mentions, names, or legal notices.

Instructions

Search the text of published Brazilian municipal official gazettes.

Each result is one gazette (one city's official publication, one edition, one
date) with a short excerpt showing where `query` matched. This searches gazette
*content*, not city metadata — resolve a city name to its territory_id with
`search_cities` first.

`query` uses OpenSearch's "simple query string syntax": bare words are OR'd
together, a leading `+` requires a term, a leading `-` excludes it, and double
quotes match an exact phrase — e.g. '"João da Silva"' for an exact name, or
'+licitação +pregão' to require both terms together. An empty query returns
matching gazettes' metadata without excerpts.

`territory_ids` restricts the search to specific cities by their 7-digit IBGE ID
(from `search_cities` or `get_city`); omit it to search across all available
cities. `published_since` / `published_until` are inclusive ISO dates
(YYYY-MM-DD) bounding the gazette's publication date — leave both unset to search
the full available history. `size` is capped at 50 results per call; use `offset`
to page through more. `sort_by` defaults to relevance; use "descending_date" or
"ascending_date" to sort chronologically instead.

Example: to find mentions of "Empresa X" in Porto Alegre gazettes published
between January and July 2026, once territory_id "4314902" is known, call
search_gazettes(query='"Empresa X"', territory_ids=["4314902"],
published_since="2026-01-01", published_until="2026-07-31").

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sizeNo
queryNo
offsetNo
sort_byNorelevance
territory_idsNo
published_sinceNo
published_untilNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
gazettesYes
total_gazettesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A5/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so thoroughly: each result is one gazette with an excerpt, empty queries return metadata without excerpts, dates are inclusive, size is capped at 50, and sort defaults to relevance. This goes well beyond the schema in explaining actual behavior.

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 long but justified by seven undocumented parameters and no annotations. It is front-loaded with the core semantics, organized into focused paragraphs per concern, and closes with a complete example, with no filler.

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's complexity, optional parameters, and lack of annotations/schema descriptions, the description is complete: it covers result units, matching behavior, all filters, defaults, limits, pagination, and a realistic example. The presence of an output schema means return-value details are already covered elsewhere.

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?

Schema description coverage is 0%, so the description must explain every parameter, and it does: query syntax (OR, +, -, quoted phrases), territory_ids as 7-digit IBGE IDs, inclusive ISO dates, size/offset pagination, and sort_by values. The included example ties the parameters together concretely.

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 opens with a specific verb and resource: 'Search the text of published Brazilian municipal official gazettes.' It then explicitly distinguishes gazette content from city metadata and points to search_cities, making the purpose unmistakable and differentiating it from sibling tools.

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?

It gives a clear workflow: resolve a city name to territory_id with search_cities first, or omit territory_ids to search all cities. It also explains query syntax, date filtering, pagination, and sort options, so an agent knows exactly when and how to invoke the tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools