Skip to main content
Glama
metaneutrons

German Legal MCP Server

by metaneutrons

dip:get

Retrieve full text of German parliamentary documents (Bundestagsdrucksachen) by document number, including legislative reasoning and specific sections.

Instructions

Retrieve full text of a Bundestagsdrucksache by Dokumentnummer (e.g., "19/27426" for BT-Drs. 19/27426). Returns the extracted text including Gesetzesbegründung. Use section for partial content or save_path to save to file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dokumentnummerYesDokumentnummer (e.g., "19/27426", "20/1234")
sectionNoSection to extract: heading text (e.g., "Zu § 5 UrhDaG-E", "Begründung", "Zu Artikel 1") or "lines:100-200"
save_pathNoSave full document to this file path instead of returning content

Implementation Reference

  • The `handleGet` function implements the logic for 'dip:get', which retrieves the text of a Drucksache, optionally saving it or extracting a specific section.
    export async function handleGet(client: DipClient, args: Record<string, unknown>): Promise<ToolResult> {
      const { dokumentnummer, section, save_path } = args as {
        dokumentnummer: string; section?: string; save_path?: string;
      };
    
      // Search by dokumentnummer in the -text endpoint to get full text
      const result = await client.searchDrucksachenText({ 'f.dokumentnummer': dokumentnummer, rows: 1 });
      if (!result.documents.length) {
        return { content: [{ type: 'text', text: `Drucksache ${dokumentnummer} not found.` }], isError: true };
      }
    
      const doc = result.documents[0];
      const fullText = doc.text ?? '';
      const header = `# BT-Drs. ${doc.dokumentnummer}\n\n**${doc.titel.replace(/\r\n/g, ' ').trim()}**\nDatum: ${doc.datum}\n${doc.fundstelle?.pdf_url ? `PDF: ${doc.fundstelle.pdf_url}` : ''}\n\n---\n\n`;
    
      if (save_path) {
        mkdirSync(dirname(save_path), { recursive: true });
        writeFileSync(save_path, header + fullText, 'utf-8');
        return { content: [{ type: 'text', text: `Saved to ${save_path} (${fullText.length} chars)` }] };
      }
    
      if (section) {
        const extracted = extractSection(fullText, section);
        return { content: [{ type: 'text', text: extracted }] };
      }
    
      // Default: return header + first 2000 chars as preview
      const preview = fullText.length > 2000 ? fullText.slice(0, 2000) + '\n\n[...truncated. Use `section` or `save_path` for full content.]' : fullText;
      return { content: [{ type: 'text', text: header + preview }] };
    }
  • Registration of the 'dip:get' tool definition and input schema.
    name: 'dip:get',
    description:
      'Retrieve full text of a Bundestagsdrucksache by Dokumentnummer (e.g., "19/27426" for BT-Drs. 19/27426). ' +
      'Returns the extracted text including Gesetzesbegründung. Use `section` for partial content or `save_path` to save to file.',
    inputSchema: z.object({
Behavior3/5

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

No annotations provided, so description carries full burden. Discloses return content ('extracted text including Gesetzesbegründung') and critical behavioral branch (save_path saves to file 'instead of returning content'). Omits safety profile, rate limits, or error conditions, but 'Retrieve' implies read-only operation.

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 sentences, zero waste. Front-loaded with core action (retrieve by Dokumentnummer), followed by output description, then optional parameter guidance. Every clause provides distinct information not redundant with schema or name.

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?

Appropriate for a 3-parameter retrieval tool with simple schema. Covers document specificity, output format, and optional behaviors. No output schema exists, but description adequately explains return values. Minor gap: doesn't mention error handling for invalid dokumentnummer formats.

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?

Schema coverage is 100%, establishing baseline 3. Description adds value by explaining the functional purpose of optional parameters: section enables 'partial content' extraction and save_path triggers file persistence rather than return. Elevates above baseline by clarifying when to use these options.

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 specific verb 'Retrieve' with resource 'Bundestagsdrucksache' and identifier method 'Dokumentnummer'. The term 'Bundestagsdrucksache' clearly distinguishes this from siblings handling arxiv papers, EU law, or court decisions. Includes concrete example format '19/27426'.

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 clear guidance on optional parameters: 'Use `section` for partial content' and save_path 'to save to file.' Lacks explicit contrast with dip:search (when to search vs. get by ID), though this is somewhat implied by the 'get' vs 'search' naming convention.

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