Skip to main content
Glama

eurlex_sparql

Read-onlyIdempotent

Execute raw SPARQL queries against the EU Publications Office endpoint to retrieve legal documents when standard tools cannot express your search. Requires knowledge of the CDM ontology.

Instructions

Expert escape hatch: run a raw, read-only SPARQL 1.1 query directly against the EU Publications Office (Cellar) endpoint when the higher-level tools (eurlex_search, eurlex_metadata, eurlex_citations, eurlex_case_law, eurlex_transposition, eurlex_summary, …) cannot express what you need. Requires knowledge of the CDM ontology — READ THE eurlex_guide PROMPT FIRST for the property cheat sheet (celex, title, language, dates, citations, case law, transposition, summaries). Only SELECT and ASK are allowed; SPARQL Update (INSERT/DELETE/…) and federated SERVICE clauses are rejected before the query is sent. A SELECT with no top-level LIMIT gets LIMIT 50 appended (set limit_added); a top-level LIMIT above 100 is rejected. The response mirrors SPARQL JSON — vars + bindings for SELECT, boolean for ASK — plus row_count and a truncated flag (whole rows are dropped past ~40k characters). CELEX/ELI literals are typed xsd:string, so match them with FILTER(STR(?x) = "..."). Example: PREFIX cdm: http://publications.europa.eu/ontology/cdm# SELECT ?celex WHERE { ?w cdm:resource_legal_id_celex ?celex . FILTER(STR(?celex) = "32016R0679") } LIMIT 1

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesA raw SPARQL 1.1 query against the EU Publications Office (Cellar) endpoint. Read-only: only SELECT and ASK are accepted (SPARQL Update and federated SERVICE clauses are rejected). If a SELECT has no top-level LIMIT one is appended automatically; a top-level LIMIT above 100 is rejected. Uses the CDM ontology — see the eurlex_guide prompt for the property cheat sheet. Example: PREFIX cdm: <http://publications.europa.eu/ontology/cdm#> SELECT ?celex WHERE { ?w cdm:resource_legal_id_celex ?celex . FILTER(STR(?celex) = "32016R0679") } LIMIT 1

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
varsNoProjected variable names (SELECT only)
booleanNoASK result (present only for ASK queries)
bindingsNoRaw SPARQL binding rows, possibly truncated (SELECT only)
row_countYesTotal rows the query returned; null for ASK
truncatedYesTrue when whole rows were dropped to fit the char budget
limit_addedNoPresent (true) only when the tool auto-appended the default LIMIT
returned_rowsYesRows included after char-budget truncation; null for ASK

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.4.2
  2. Removedv2.3.0
  3. First observedv2.2.0

TDQS

A4.9/5.0
Behavior5/5

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

The annotations already declare readOnlyHint/openWorldHint/idempotentHint/destructiveHint, and the description reinforces and expands on them: only SELECT/ASK are accepted, SPARQL Update and federated SERVICE are rejected, LIMIT is auto-appended or capped, and response truncation is described. The example and type note about xsd:string literals add concrete behavioral detail.

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?

The description is long but every sentence carries meaningful operational detail; it is organized from purpose to constraints to output and example. It is slightly repetitive with the input schema description, but not padded enough to lose clarity.

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?

For a raw query execution tool, the description covers what the tool does, when to use it, what queries are allowed, what happens with LIMIT, what the response looks like (SPARQL JSON, row_count, truncated flag), and how to correctly compare CELEX/ELI literals. An agent has enough information to use it correctly without external context.

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?

The single query parameter is thoroughly documented: it includes min/max lengths, restrictions on query forms, the automatic LIMIT behavior, the CDM ontology context, a concrete example query, and the CELEX/ELI string-matching caveat. This goes far beyond the schema's basic property description.

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 ('run a raw, read-only SPARQL 1.1 query') and a specific resource ('EU Publications Office (Cellar) endpoint'). It explicitly frames itself as an escape hatch for when higher-level tools cannot express the need, distinguishing it from the 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?

Explicitly says to use this when higher-level tools cannot express what is needed, and directs the agent to read the eurlex_guide prompt first for ontology knowledge. It also clearly states the allowed query forms, the automatic LIMIT behavior, and the rejection of UPDATE/SERVICE clauses.

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