Skip to main content
Glama

Search legislation

search_legislation
Read-only

Search Spain's consolidated legislation by title, text or official number, filtering by state or regional scope and publication dates. Retrieve rules in force from the BOE gazette.

Instructions

Search Spain's consolidated legislation: laws, royal decrees, orders and more.

Give at least one of title_words, text_words or official_number. Results come newest publication first. The collection holds the most relevant state and regional rules, not every item ever published in the BOE.

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": "search_legislation"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
scopeNoState rules or regional (autonómicas) rules. Defaults to both.
offsetNo
text_wordsNoWords that must all appear in the full text.
title_wordsNoWords that must all appear in the title.
published_toNo
only_in_forceNoLeave out rules the BOE marks as no longer in force.
published_fromNo
official_numberNoOfficial number, such as 3/2018 or 39/2015.

Output Schema

NameRequiredDescriptionDefault
noticeNoBasado en datos de la Agencia Estatal Boletín Oficial del Estado (https://www.boe.es). Texto consolidado de carácter meramente informativo: solo la versión electrónica firmada del BOE, en PDF, es oficial y auténtica.
resultsYes
next_offsetNoPass it as offset to get the next page; null on the last page.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and openWorldHint, so safety is covered. The description adds genuine behavior beyond that: result ordering ('newest publication first') and a coverage caveat about which documents exist in the collection. Pagination via limit/offset and the default behavior of the in-force filter are left undisclosed.

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: what it searches, the hard constraint for calling it, then the ordering and coverage caveats. The constraint is front-loaded and nothing is redundant.

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?

An output schema exists, so return values need no explanation, and the search-input constraint is well covered. Against nine parameters and a date-filtered corpus, though, the description says nothing about how published_from/published_to interact with each other or about the only_in_force default that silently narrows results.

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 coverage is 56%, so the description needs to carry weight on the undocumented parameters. It reinforces title_words, text_words, official_number and the state/regional scope split, and adds the cross-parameter 'at least one of' rule which the schema does not express. However published_from, published_to, only_in_force, limit and offset get no treatment, leaving the compensation incomplete.

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?

The description names a specific verb (search), a specific corpus (Spain's consolidated legislation), and enumerates the resource types returned (laws, royal decrees, orders). It is not a restatement of the name or title, but it never explicitly distinguishes itself from get_legislation or read_legislation_block.

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?

It gives a concrete precondition — 'Give at least one of title_words, text_words or official_number' — which is exactly the kind of guidance an agent needs since the schema marks zero required parameters. It also scopes expectations with 'not every item ever published in the BOE'. It stops short of naming when to switch to a sibling retrieval tool.

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