Skip to main content
Glama
metaneutrons

German Legal MCP Server

by metaneutrons

eul:search

Search EU legislation like directives and regulations using EUR-Lex. Find CELEX numbers, titles, and dates for German legal research.

Instructions

Search EU legislation (directives, regulations, treaties) via EUR-Lex SPARQL endpoint. Returns CELEX numbers, titles, and dates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch term in title (e.g., "Urheberrecht", "Datenschutz", "Verbraucherschutz")
resource_typeYesFilter by type (default: any)any
languageYesLanguage code (default: DE)DE
limitYesMaximum results (default: 10)

Implementation Reference

  • The handleSearch method within EulProvider executes the SPARQL query against the EUR-Lex endpoint to implement eul:search.
      private async handleSearch(args: Record<string, unknown>): Promise<ToolResult> {
        const { query, resource_type = 'any', language = 'DE', limit = 10 } = args as {
          query: string; resource_type?: string; language?: string; limit?: number;
        };
    
        const lang3 = LANG_MAP[language.toUpperCase()] || 'DEU';
    
        let typeFilter = '';
        if (resource_type !== 'any' && RESOURCE_TYPES[resource_type]) {
          typeFilter = `?work cdm:work_has_resource-type <http://publications.europa.eu/resource/authority/resource-type/${RESOURCE_TYPES[resource_type]}> .`;
        }
    
        const sparql = `PREFIX cdm: <http://publications.europa.eu/ontology/cdm#>
    SELECT DISTINCT ?celex ?title WHERE {
      ?work cdm:resource_legal_id_celex ?celex .
      ${typeFilter}
      ?expr cdm:expression_belongs_to_work ?work .
      ?expr cdm:expression_uses_language <http://publications.europa.eu/resource/authority/language/${lang3}> .
      ?expr cdm:expression_title ?title .
      FILTER(CONTAINS(LCASE(?title), LCASE("${query.replace(/"/g, '\\"')}")))
    } LIMIT ${limit}`;
    
        logger.info('Searching EUR-Lex', { query, resource_type });
        const response = await axios.get(SPARQL_URL, {
          params: { query: sparql },
          headers: { 'Accept': 'application/sparql-results+json' },
        });
    
        const bindings = response.data.results?.bindings || [];
        const markdown = bindings.map((b: Record<string, { value: string }>, i: number) =>
          `${i + 1}. **${b.celex.value}**\n   ${b.title.value.slice(0, 200)}${b.title.value.length > 200 ? '…' : ''}`
        ).join('\n\n');
    
        return {
          content: [{ type: 'text', text: `Found ${bindings.length} results:\n\n${markdown}` }],
        };
      }
  • The input schema definition and tool description for eul:search.
    {
      name: 'eul:search',
      description:
        'Search EU legislation (directives, regulations, treaties) via EUR-Lex SPARQL endpoint. ' +
        'Returns CELEX numbers, titles, and dates.',
      inputSchema: z.object({
        query: z.string().describe('Search term in title (e.g., "Urheberrecht", "Datenschutz", "Verbraucherschutz")'),
        resource_type: z.enum(['any', 'directive', 'regulation', 'decision', 'treaty']).optional().default('any')
          .describe('Filter by type (default: any)'),
        language: z.string().optional().default('DE').describe('Language code (default: DE)'),
        limit: z.number().optional().default(10).describe('Maximum results (default: 10)'),
      }),
    },
  • The dispatch logic within handleToolCall that routes 'eul:search' to its handler.
    if (toolName === 'eul:search') return this.handleSearch(args);
Behavior3/5

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

With no annotations provided, the description carries the full burden. It adds valuable behavioral context by disclosing the data source (EUR-Lex SPARQL endpoint) and return format (CELEX numbers, titles, dates). However, it omits other behavioral traits like rate limiting, caching behavior, or error handling that would be useful given the lack of annotations.

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?

The description consists of two efficient sentences with zero waste. The first sentence establishes the action and mechanism; the second documents the return values. Every word 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?

Given the absence of an output schema, the description appropriately compensates by explicitly stating the return fields (CELEX numbers, titles, dates). It successfully covers the tool's purpose for a 4-parameter search operation, though mentioning the relationship to 'eul:get_document' (which likely consumes CELEX numbers) would further complete the workflow context.

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?

The input schema has 100% description coverage, establishing a baseline of 3. The description mentions 'directives, regulations, treaties' which aligns with the resource_type enum, but does not add significant semantic detail beyond what the schema already provides (e.g., no examples of query syntax or CELEX number format).

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 clearly states the tool searches 'EU legislation (directives, regulations, treaties)' using a specific verb and resource. It implicitly distinguishes from sibling 'eul:get_document' by specifying that it returns metadata (CELEX numbers, titles, dates) rather than full documents, though explicit differentiation would strengthen this further.

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 description implies usage context by documenting the return format (CELEX numbers, titles, dates), suggesting this is for discovery/metadata retrieval rather than full-text retrieval. However, it lacks explicit when-to-use guidance or comparison with alternatives like 'eul:get_document'.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/metaneutrons/german-legal-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server