Skip to main content
Glama

leis-mcp

leis-mcp is an MCP server for the Brazilian legislation corpus viniciusdsandrade/leis. It finds, reads and cites norms from a local, read-only clone of the corpus.

IMPORTANT

The texts are for information only. They do not replace the publication in the Diário Oficial. Always cite thefonte field of the result.

What it does

  • It searches norms by words and filters. It searches the title and the summary, and it can also search the body.

  • It reads a full norm in pages of articles, or one provision: article, paragraph, item or letter.

  • It counts norms by sphere, kind, UF, agency, court, city and decade.

  • It shows the gaps of the corpus for a slice, and the state of the local index.

  • It shows who signed a norm, from the base commits of the corpus history.

Related MCP server: lex-rag

Status

Version 0.1.0. The package is not on npm yet. Use it from the source code (see Install). After the release, npx -y leis-mcp starts it.

Requirements

  • Node.js 22 or later.

  • git 2.27 or later.

  • ripgrep (rg). It is necessary only for body search in folders that are not in LEIS_CORPO.

Install

git clone https://github.com/viniciusdsandrade/brasil-legislacao-mcp
cd brasil-legislacao-mcp
npm ci
npm run build
node dist/cli.js sync

Then connect your MCP client. For Claude Code, see clients/claude-code.

Commands

Command

What it does

leis-mcp or leis-mcp serve

Starts the MCP server on stdio.

leis-mcp sync

Clones or updates the corpus and the index. It writes a JSON report to stdout.

leis-mcp status

Shows the state of the index.

leis-mcp --version

Shows the version.

How sync works

  1. It clones the corpus with git clone --filter=blob:none --sparse. Git does not download file contents outside the scope.

  2. It sets a cone sparse checkout from LEIS_ESCOPO.

  3. It runs git pull --ff-only.

  4. It reads the changes from the indexed commit to HEAD and indexes them in batches.

  5. It indexes new scope entries in full.

  6. It reads the authorship from the base commits of the history.

  7. It writes the new commit to the index only at the end.

If the sync stops, run it again. Each write is idempotent. A second sync without changes in the corpus changes nothing.

The full history without file contents is about 295 MiB. The server reads only the local index and the local clone. It never calls the GitHub API.

Configuration

Use environment variables. Use the same values for sync and for the server.

Variable

Default

Meaning

LEIS_REMOTO

https://github.com/viniciusdsandrade/leis.git

Git repository of the corpus.

LEIS_RAMO

main

Branch of the corpus.

LEIS_CLONE

~/.cache/leis-mcp/acervo

Folder of the partial clone.

LEIS_INDICE

~/.cache/leis-mcp/indice.sqlite

SQLite file of the index.

LEIS_ESCOPO

constituicao,federal

Spheres and folders in the clone, for example constituicao,federal,estaduais/SP,municipais/SP/campinas.

LEIS_CORPO

(empty)

Folders whose body goes into the FTS5 index, for example constituicao,federal/leis-ordinarias.

LEIS_ORCAMENTO_TOKENS

8000

Token budget of each result.

LEIS_RG

rg

ripgrep program.

LEIS_GIT

git

git program.

LEIS_LOG

info

Log level: erro, aviso, info or depuracao. The log goes to stderr.

When XDG_CACHE_HOME is set, the cache folder is $XDG_CACHE_HOME/leis-mcp.

Tools

All tools have the hints readOnlyHint and idempotentHint.

Tool

Use it to

Main parameters

leis_buscar

Find norms.

texto, esfera, uf, municipio, orgao, tribunal, tipo, numero, data_de, data_ate, revogada, alcance (cabecalho or texto), limite (10, maximum 50), cursor, formato

leis_obter

Read a norm or one provision.

referencia (path, leis:// URI, LexML URN or citation), artigo, paragrafo, inciso, alinea, bloco, esfera, uf, incluir_tachado, cursor, formato

leis_facetas

Count norms.

dimensoes (esfera, tipo, uf, orgao, tribunal, municipio, decada), texto, the filters, limite

leis_cobertura

Show the gaps of a slice and the state of the index.

esfera, uf, municipio, orgao, tribunal, tipo

leis_autoria

Show the signatories of a norm, or the norms of a signatory.

referencia or signatario, limite, cursor, formato

Examples of citations for referencia:

  • Lei 8.078/1990, Lei nº 8.078, de 11 de setembro de 1990

  • LC 123/2006, MP 2.200-2/2001, Decreto-Lei 5.452/1943

  • CF art. 5º, XI, art. 5º, XI, da CF, ADCT art. 10

  • CDC art. 49, CLT art. 2º, LGPD

  • Súmula 7 do STJ, Súmula Vinculante 13

  • urn:lex:br:federal:lei:1990-09-11;8078

The server also has the resource template leis://{caminho}. The path is encoded, for example leis://federal%2Fleis-ordinarias%2F1990%2Flei-8078-1990-09-11.md. leis_obter gives the URI of each norm.

Response contract

  • Items are compact: caminho, titulo, tipo, numero, data, uf, a short ementa, situacao, fonte, versao_texto, baixado_em and ocr. Use formato: completo to get all fields and the URI.

  • Each result has fonte, versao_texto and baixado_em. OCR text has ocr: true and a notice.

  • leis_obter removes struck text by default and tells how many parts it removed. Use incluir_tachado: true to see them.

  • A result without items tells the coverage of the slice. Absence in the local corpus does not prove that a norm does not exist.

  • Each result has structuredContent and a text block with the same JSON.

  • Each error has a code, a message and the next step.

  • A result that is larger than the token budget is cut. Use the cursor of the result to get the next page.

Safety

  • The server accepts only .md paths of norms in the clone. It refuses .., absolute paths, hidden segments, segments that start with _ and symbolic links that go out of the clone.

  • Subprocesses start with an argument list and without a shell. User terms come after --. ripgrep runs with --no-config and never with --pre.

  • User text goes into FTS5 only as quoted strings. Operators, column filters and parentheses become plain text.

  • The server opens the index read-only. Only sync writes to the index and the clone.

Architecture

src/core/          Domain rules, use cases and ports. No MCP code and no I/O.
src/adaptadores/   Adapters for SQLite FTS5, git, ripgrep, the file system and MCP.
src/cli.ts         Composition root: serve, sync and status.
clients/           Installation files for each MCP client.
test/              vitest tests with small fixtures.

The plan for the agents is in docs/plan.md. The analysis of the corpus and the decisions are in ADR 0001.

Development

npm ci
npm run typecheck
npm test
npm run build

The GitHub Actions workflow runs these steps on Node 22 and Node 24.

License

The code is under the MIT license. See LICENSE.

The texts of the norms are official acts. Article 8, item IV, of Lei nº 9.610/1998 says that they are not subject to copyright.

Available Tools

5 tools
leis_autoriaAutoria das normasA
Read-onlyIdempotent

Mostra quem assinou uma norma (autor, coautores e origem da autoria) ou lista as normas de um signatário. Vem da base inicial do histórico; as datas vêm do cabeçalho.

NameRequiredDescriptionDefault
cursorNoCursor da resposta anterior, para a próxima página. Use sem mudar os outros parâmetros.
limiteNoItens por página.
formatoNoresumido: campos essenciais e ementa curta. completo: todos os metadados do índice.resumido
referenciaNoNorma cuja autoria você quer ver: caminho, URN ou citação. Use referencia ou signatario.
signatarioNoNome de quem assinou, para listar as normas dessa pessoa ou instituição. Use referencia ou signatario.

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, non-destructive and closed-world, so the safety profile is covered. The description adds a genuine provenance caveat ('Vem da base inicial do histórico; as datas vêm do cabeçalho'), warning that data may be partial — useful, though cryptically worded and silent on pagination or completeness limits.

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?

Two short sentences, front-loaded with the dual capability, followed by a single provenance caveat. No filler and nothing repeated from the title.

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?

Covers both query modes for a tool with five optional parameters and no required ones, which is the key thing an agent needs. The one gap is that it never says what happens if neither referencia nor signatario is supplied, leaving the zero-argument path undefined.

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?

Schema description coverage is 100%, including the enum for formato and the mutual-exclusion note on referencia/signatario, so the schema carries the parameter semantics. The description adds nothing about formato, limite or cursor beyond what the schema already states; baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource with two clear modes: 'Mostra quem assinou uma norma (autor, coautores e origem da autoria)' or 'lista as normas de um signatário'. An agent can tell this returns authorship data rather than norm text, but the description never names or contrasts with siblings like leis_obter or leis_buscar.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'ou' structure implies two usage paths and the description hints at choosing referencia vs signatario, but that routing is already spelled out in the schema. There is no explicit when-not guidance nor any mention of the sibling tools that overlap (e.g., obtaining the norm itself).

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

leis_buscarBuscar normasA
Read-onlyIdempotent

Busca normas no acervo local por palavras e filtros. Devolve itens compactos com caminho, título, tipo, número, data, UF, ementa, situação, fonte, versao_texto, baixado_em e marca de OCR. Use o cursor para a próxima página.

NameRequiredDescriptionDefault
ufNoSigla da UF, por exemplo SP. Vale para estaduais e municipais.
tipoNoTipo de norma: nome, sigla ou pasta. Exemplos: lei, lei complementar, decreto, decreto-lei, mp, sumula, leis-ordinarias.
orgaoNoÓrgão regulador como na pasta, por exemplo anvisa, rfb ou contran.
textoNoPalavras para buscar. Use aspas para uma frase exata e * no fim de uma palavra para prefixo. Sem texto, lista pelos filtros.
cursorNoCursor da resposta anterior, para a próxima página. Use sem mudar os outros parâmetros.
esferaNoEsfera do acervo.
limiteNoItens por página.
numeroNoNúmero da norma, por exemplo 8.078, 123 ou 2200-2.
alcanceNocabecalho: título e ementa. texto: corpo da norma (índice do corpo, ou ripgrep nas pastas do filtro).cabecalho
data_deNoData mínima da norma: AAAA-MM-DD ou só o ano AAAA.
formatoNoresumido: campos essenciais e ementa curta. completo: todos os metadados do índice.resumido
data_ateNoData máxima da norma: AAAA-MM-DD ou só o ano AAAA.
revogadaNotrue: só normas marcadas como revogadas. false: só as não revogadas.
tribunalNoTribunal, por exemplo stf, stj ou tst.
municipioNoMunicípio como na pasta do acervo, por exemplo campinas ou rio-de-janeiro.

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description goes beyond them by describing the returned item shape (path, título, tipo, número, data, UF, ementa, situação, fonte, versao_texto, baixado_em, OCR flag) and pagination via cursor, which matters because there is no output schema; it stops short of noting ordering or result-size behavior.

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?

Two sentences, front-loaded with the purpose before the return shape and pagination note. The field enumeration is long but justified given the absence of an output schema; otherwise there is no filler.

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?

With 15 optional parameters, full schema coverage and rich annotations, the description fills the main remaining gap — what comes back and how to page — which is exactly what a query tool needs absent an output schema. Minor omissions like result ordering or behavior when no filters are supplied are low-stakes.

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?

Schema description coverage is 100% and the schema already documents every parameter with examples, enums and defaults (including the 'sem texto, lista pelos filtros' rule and alcance modes). The description only gestures at 'palavras e filtros' and the cursor, so it adds no parameter meaning beyond the schema — baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Busca normas') and scopes it to the local corpus ('acervo local'), which is meaningfully different from a web search. It does not name or differentiate against siblings like leis_obter or leis_facetas, so an agent must infer that this is the search/list entry point versus a single-record fetch.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by 'por palavras e filtros', and the description adds a procedural hint about using the cursor for the next page. However, it never states when to choose this over leis_obter or leis_facetas, nor any exclusions or prerequisites, leaving routing between siblings to inference.

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

leis_coberturaCobertura do acervoA
Read-onlyIdempotent

Mostra as lacunas de um recorte (COBERTURA.md, PROGRESSO.md e _falhas.jsonl) e o estado do índice local: commit, data do sync, escopo e totais.

NameRequiredDescriptionDefault
ufNoSigla da UF, por exemplo SP. Vale para estaduais e municipais.
tipoNoTipo de norma: nome, sigla ou pasta. Exemplos: lei, lei complementar, decreto, decreto-lei, mp, sumula, leis-ordinarias.
orgaoNoÓrgão regulador como na pasta, por exemplo anvisa, rfb ou contran.
esferaNoEsfera do acervo.
tribunalNoTribunal, por exemplo stf, stj ou tst.
municipioNoMunicípio como na pasta do acervo, por exemplo campinas ou rio-de-janeiro.

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false. The description adds real context beyond them: it reveals the underlying artifacts read (COBERTURA.md, PROGRESSO.md, _falhas.jsonl) and enumerates the reported fields, so the agent knows this is a local-state diagnostic rather than a live query.

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?

One sentence, front-loaded with what is produced and backed by a parenthetical of concrete outputs. The embedded file names are semi-implementation detail but serve as evidence of what is being read, not filler.

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?

With no output schema, the description must sketch the return value, and it does (commit, data do sync, escopo, totais) while framing the tool as a read-only coverage check. What the 'recorte' filters actually do is left to the 100%-covered schema, which is reasonable.

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?

Schema description coverage is 100% with 6 optional filter parameters, each documented with examples and one enum. The description only gestures at them through 'recorte' and 'escopo' without explaining how uf/tipo/orgao/esfera/tribunal/municipio narrow the slice, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Mostra') and a specific resource (lacunas de um recorte plus local index state: commit, sync date, scope, totals). This clearly separates it from the retrieval siblings (buscar, obter, facetas, autoria), though it never names them explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: the agent infers it should call this to check coverage gaps or index freshness. There is no explicit 'use when' statement, no exclusion criteria, and no pointer to a sibling for the alternative case.

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

leis_facetasContar normasA
Read-onlyIdempotent

Conta normas por esfera, tipo, UF, órgão, tribunal, município e década, com os mesmos filtros de leis_buscar.

NameRequiredDescriptionDefault
ufNoSigla da UF, por exemplo SP. Vale para estaduais e municipais.
tipoNoTipo de norma: nome, sigla ou pasta. Exemplos: lei, lei complementar, decreto, decreto-lei, mp, sumula, leis-ordinarias.
orgaoNoÓrgão regulador como na pasta, por exemplo anvisa, rfb ou contran.
textoNoRestringe as contagens às normas cujo título ou ementa têm estas palavras.
esferaNoEsfera do acervo.
limiteNoValores por dimensão.
numeroNoNúmero da norma, por exemplo 8.078, 123 ou 2200-2.
data_deNoData mínima da norma: AAAA-MM-DD ou só o ano AAAA.
data_ateNoData máxima da norma: AAAA-MM-DD ou só o ano AAAA.
revogadaNotrue: só normas marcadas como revogadas. false: só as não revogadas.
tribunalNoTribunal, por exemplo stf, stj ou tst.
dimensoesNoDimensões a contar. Padrão: esfera, tipo e decada.
municipioNoMunicípio como na pasta do acervo, por exemplo campinas ou rio-de-janeiro.

TDQS

A4.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, covering the safety profile. The description adds the useful cross-reference that filters mirror leis_buscar, but it does not clarify return shape or how 'limite' interacts across multiple dimensions, which matters for a 13-parameter aggregation tool.

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?

A single front-loaded sentence that states the action, dimensions and filter relationship with zero filler. Every clause carries information.

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

Completeness3/5

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

For a read-only aggregation tool with a fully documented 13-parameter schema, the description is adequate but thin: it never states that the result is counts grouped per requested dimension or how 'limite' caps each dimension's bucket, and no output schema exists to fill that gap.

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 coverage is 100%, so a baseline of 3 applies. The description earns extra credit by asserting the filter set is the same as leis_buscar, which conveys semantics (matching/filtering behavior) the schema itself does not state, and its dimension list corroborates the 'dimensoes' enum.

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 ('conta') and resource ('normas'), and enumerates the exact dimensions aggregated (esfera, tipo, UF, órgão, tribunal, município, década). It also distinguishes itself from the sibling leis_buscar by positioning itself as the counting counterpart with the same filters.

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 phrase 'com os mesmos filtros de leis_buscar' implicitly tells the agent to use this tool when aggregates are wanted instead of document listings, and that filter semantics are shared with the sibling. However, there is no explicit 'when not to use' or a direct statement contrasting it with leis_buscar in an imperative form.

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

leis_obterLer norma ou dispositivoA
Read-onlyIdempotent

Lê uma norma por caminho, URN ou citação, inteira (paginada por artigo) ou só um dispositivo. Omite redações tachadas por padrão e avisa. Se a citação for ambígua, devolve candidatos.

NameRequiredDescriptionDefault
ufNoUF, para desempatar uma citação de norma estadual ou municipal.
blocoNoBloco da norma quando a numeração recomeça, por exemplo adct na Constituição. Use o índice ou parte do título.
alineaNoAlínea: a, b, c.
artigoNoArtigo, por exemplo 5, 5º, 4-A ou 1.000. Tem precedência sobre o artigo da citação.
cursorNoCursor da resposta anterior, para a próxima página. Use sem mudar os outros parâmetros.
esferaNoEsfera, para desempatar uma citação.
incisoNoInciso em romano ou número: XI ou 11.
formatoNoresumido: campos essenciais e ementa curta. completo: todos os metadados do índice.resumido
paragrafoNoParágrafo: 2, 2º ou único.
referenciaYesCaminho do acervo (campo caminho de leis_buscar), URI leis://, URN LexML ou citação: "Lei 8.078/1990", "LC 123/2006", "CF art. 5º, XI", "ADCT art. 10", "CDC art. 49", "Súmula 7 do STJ".
incluir_tachadoNotrue mostra as redações tachadas (antigas ou revogadas). O padrão omite e avisa.

TDQS

A3.8/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 real behavior beyond that: struck-through text is omitted by default with a warning, pagination is per article, and ambiguous citations return candidate matches instead of failing. It does not say what a paginated response contains beyond the cursor reference.

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?

Three short sentences, front-loaded with the core action and mode, then the default omission behavior, then the ambiguity fallback. No filler.

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 an 11-parameter read tool with full schema coverage and annotations, the description covers the key decision points (reference forms, whole-norm vs. article, struck-text default, ambiguity). The main gap is return shape — e.g., that the response carries a next cursor — which is left to the parameter docs.

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?

Schema description coverage is 100%, so every parameter (uf, esfera, bloco, artigo precedence, cursor, incluir_tachado) is already documented in the schema. The description only restates the reference forms and the pagination mode, adding no syntax or precedence detail beyond what the schema provides — baseline 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (lê) and resource (norma/dispositivo) plus the accepted reference forms (caminho, URN, citação) and the two read modes (inteira paginada por artigo vs. dispositivo isolado). It does not name the sibling leis_buscar in the description itself, so differentiation from search is only implied (the path link appears in the schema).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied: this is the retrieval tool for a known norm, as opposed to searching. The ambiguous-citation fallback ('devolve candidatos') tells the agent what happens but not explicitly when to prefer leis_buscar over this tool or how to recover from ambiguity. No explicit exclusions.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updatesv0.1.0
    • First observedleis_autoria
    • First observedleis_buscar
    • First observedleis_cobertura
    • First observedleis_facetas
    • First observedleis_obter

TDQS

A3.9/5.0

Scored across 5 tools

Disambiguation5/5

Each tool targets a distinct operation: leis_buscar lists matching norms, leis_facetas aggregates counts, leis_obter retrieves a single norm's text, leis_cobertura reports index/coverage diagnostics, and leis_autoria handles authorship. The shared filter vocabulary between buscar and facetas is explicitly signposted, and their outputs (items vs. counts) are clearly different, so an agent can select confidently.

Naming Consistency4/5

All names share the same 'leis_' namespace prefix and are lowercase snake-style, which makes the set predictable. The only wrinkle is a mixed verb/noun pattern (buscar, obter are verbs; facetas, cobertura, autoria are nouns), but this still reads naturally and doesn't impede selection.

Tool Count5/5

Five tools is a tight, well-scoped surface for a local legal-norm archive: one search, one fetch, one aggregation, one diagnostics, one authorship. Nothing appears redundant and no obvious capability is bolted on unnecessarily.

Completeness4/5

The read-only lifecycle for the domain is well covered: discovery (buscar), retrieval (obter), aggregation (facetas), corpus health (cobertura), and provenance (autoria). Minor gaps exist — no dedicated version-history/comparison tool despite versao_texto being exposed, and no explicit export/raw-text operation — but agents can work around these via obter.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    Enables searching and retrieving Brazilian legislative propositions, reading their full texts, finding related propositions, and accessing dataset releases and downloads with provenance and official source URLs.
    7
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Serves legal retrieval-augmented generation over Brazilian federal legislation, returning exact statutory text with URN-LEX and Planalto URLs to prevent hallucination, running locally with optional GPU acceleration.
    5
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Provides a local, searchable index of Sergipe Court of Justice decisions, enabling full-text retrieval with receipts, literal citation verification, and citation mapping for legal writing.
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables Brazilian legal practitioners to search and verify case law, súmulas, and federal legislation against official sources, and to audit entire draft documents citation by citation with source provenance, collection dates, and verification status. Every response carries its own verification flag so a failed source lookup never silently becomes "no results", and citations blocked by anti-bot protections are returned as pending manual review with an official search link.
    MIT