Skip to main content
Glama

Contar normas

leis_facetas
Read-onlyIdempotent

Count Brazilian legal norms by sphere, type, UF, agency, court, municipality, or decade using search filters, so you can profile legislation coverage and distribution.

Instructions

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

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "leis_facetas"
  }
}

Input Schema

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 revogadas ou sem vigor segundo a fonte oficial. false: tira essas normas; as normas sem informação de vigência continuam.
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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.0
    • changedInput schema / properties / revogada / description
      Previous value: -"true: só normas marcadas como revogadas. false: só as não revogadas."New value: +"true: só normas revogadas ou sem vigor segundo a fonte oficial. false: tira essas normas; as normas sem informação de vigência continuam."
  2. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered. The description adds that filters behave like leis_buscar, but says nothing about the shape of the aggregated result, how the limite cap affects each dimension, or whether missing dimensions are omitted or returned empty.

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?

A single sentence that front-loads the verb, the resource and the grouping dimensions with no filler. It is compact and readable, though the trailing clause about matching leis_buscar filters is tacked on rather than structured.

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?

With 13 optional parameters and no output schema, the definition leans entirely on a fully documented schema. An agent can call it, but must guess what the response looks like (counts per dimension value) since the description never mentions the return format or the default dimension set.

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 already carries its own explanation, including the dimensoes default. The description's only added semantic is the cross-reference that filters mirror leis_buscar, which is a modest but real gain over the schema.

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 ('Conta normas') and enumerates the aggregation dimensions, which clearly distinguishes an aggregate/tally tool from the sibling leis_buscar. It stops short of explicitly saying it returns counts rather than documents, which would make the contrast sharper.

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?

By naming leis_buscar and saying it takes the same filters, the description implies this is the aggregation counterpart to that search tool. It never states when to pick counting over listing, or what happens with zero filters, so usage is inferable rather than spelled out.

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