Skip to main content
Glama
metaneutrons

German Legal MCP Server

by metaneutrons

eul:get_document

Retrieve EU legislation documents by CELEX number from EUR-Lex. Extract specific sections or save full text to files for legal research and analysis.

Instructions

Retrieve EU legislation from EUR-Lex by CELEX number (e.g., "32016R0679" for GDPR, "32001L0029" for InfoSoc). Returns full text in Markdown. Use section for partial content: "Art. 5", "Artikel 5", or "lines:100-200". Use save_path to save to file instead of returning content.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
celexYesCELEX number (e.g., "32016R0679", "32001L0029", "12016E267")
languageYesLanguage code (default: DE)DE
sectionNoExtract section: "Art. 5", "Artikel 5-10", "Kapitel III", or "lines:100-200"
save_pathNoSave full document to this file path instead of returning content

Implementation Reference

  • The handleGetDocument method performs the actual retrieval of the EUR-Lex document, handles conversion to markdown, section extraction, and optional file saving.
    private async handleGetDocument(args: Record<string, unknown>): Promise<ToolResult> {
      const { celex, language = 'DE', section, save_path } = args as {
        celex: string; language?: string; section?: string; save_path?: string;
      };
    
      logger.info('Fetching EUR-Lex document', { celex, language });
    
      const response = await axios.get(`${CELLAR_BASE}/${celex}`, {
        headers: {
          'Accept': 'text/html, application/xhtml+xml',
          'Accept-Language': `${language.toLowerCase()}, en;q=0.8`,
        },
        maxRedirects: 5,
        responseType: 'text',
      });
    
      const markdown = this.converter.convert(response.data);
      validateConversion(markdown, 'EUR-Lex');
    
      if (section) {
        const extracted = this.extractSection(markdown, section);
        if (!extracted) {
          return { content: [{ type: 'text', text: `Section "${section}" not found.` }], isError: true };
        }
        return { content: [{ type: 'text', text: extracted }] };
      }
    
      const fullDoc = `# ${celex}\n\n---\n\n${markdown}`;
    
      if (save_path) {
        const { writeFile } = await import('fs/promises');
        await writeFile(save_path, fullDoc, 'utf-8');
        return { content: [{ type: 'text', text: `Saved to ${save_path}\n\nCELEX: ${celex}\nLanguage: ${language}` }] };
      }
    
      return { content: [{ type: 'text', text: fullDoc }] };
    }
  • Definition and input schema for the 'eul:get_document' tool.
    {
      name: 'eul:get_document',
      description:
        'Retrieve EU legislation from EUR-Lex by CELEX number (e.g., "32016R0679" for GDPR, "32001L0029" for InfoSoc). ' +
        'Returns full text in Markdown. Use `section` for partial content: "Art. 5", "Artikel 5", or "lines:100-200". ' +
        'Use `save_path` to save to file instead of returning content.',
      inputSchema: z.object({
        celex: z.string().describe('CELEX number (e.g., "32016R0679", "32001L0029", "12016E267")'),
        language: z.string().optional().default('DE').describe('Language code (default: DE)'),
        section: z.string().optional().describe('Extract section: "Art. 5", "Artikel 5-10", "Kapitel III", or "lines:100-200"'),
        save_path: z.string().optional().describe('Save full document to this file path instead of returning content'),
      }),
    },
  • Registration of the 'eul:get_document' tool in the provider's handleToolCall method.
    if (toolName === 'eul:get_document') return this.handleGetDocument(args);
Behavior4/5

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

With no annotations provided, the description adequately discloses key behaviors: it specifies the return format ('full text in Markdown'), explains the mutually exclusive output modes (return content vs 'save to file'), and identifies the external data source (EUR-Lex). Lacks error handling or rate limit disclosure.

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 tightly constructed sentences with zero waste. Front-loaded with core purpose, followed by optional parameter guidance. Every word earns its place.

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?

Given the absence of an output schema, the description compensates by stating the return format ('Markdown') and content scope ('full text'). All four parameters are addressed implicitly or explicitly, and the domain-specific CELEX identifier is thoroughly contextualized.

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?

While schema coverage is 100%, the description adds significant value by providing concrete syntax examples for the 'section' parameter ('Art. 5', 'lines:100-200') and clarifying the behavioral implication of 'save_path' ('instead of returning content').

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?

The description uses a specific verb ('Retrieve') + resource ('EU legislation from EUR-Lex') + identifier ('CELEX number'), clearly distinguishing it from siblings like 'arxiv:get' or 'legis:get' through the EUR-Lex/CELEX specificity.

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?

Provides concrete usage context through real-world examples (GDPR, InfoSoc) and explains when to use specific parameters ('Use `section` for partial content'). However, it does not explicitly differentiate from the sibling 'eul:search' tool for cases when the user lacks a CELEX number.

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