Skip to main content
Glama

datajud_raw_query

Read-onlyIdempotent

Avançado: envia uma query Elasticsearch crua pro índice do tribunal (escape hatch). query é SÓ a cláusula de busca (ex.: { match: { "classe.nome": "Apelação" } }); size, sort, _source e search_after vão nos campos próprios. Use search_after (valor sort do último hit) pra paginar além de 10.000 resultados. A API pública do CNJ é lenta em índices grandes: prefira size pequeno e _source com só os campos que precisa.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fromNo
sizeNo
sortNo
queryYes
_sourceNo
tribunalYes
search_afterNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / _source
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  2. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so the safety profile is covered. The description adds genuinely useful behavior beyond that: the 10,000-result pagination ceiling, the CNJ API's slowness on large indices, and the recommendation to keep size small and _source narrow.

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?

Front-loaded with the tool's identity and role, then each following sentence delivers a distinct operational fact (query scoping, pagination, performance). No filler; every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 7-parameter, no-output-schema raw query tool, the description covers the main failure modes an agent would hit (misusing `query`, exceeding 10k without search_after, slow large queries). It omits any hint about the response shape and the `from` parameter, but is otherwise sufficient to call correctly.

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?

With 0% schema description coverage across 7 parameters, the description carries the burden and does so for the trickiest ones: it clarifies that `query` holds only the search clause (not a full ES body) and that size/sort/_source/search_after belong in their own fields. It does not explain `from` or the sort value format in detail, leaving some gaps.

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?

States a specific verb and resource (sends a raw Elasticsearch query to the court index) and explicitly frames itself as the 'escape hatch' advanced option, which distinguishes it from the structured datajud_search sibling.

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 'escape hatch'/'Avançado' framing implies when to reach for it over the structured search tool, and it gives concrete conditions for using search_after (beyond 10,000 results) and small size. It never explicitly names datajud_search as the default alternative, so it stops short of a full when/when-not statement.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.