European Parliament MCP Server API - v1.0.1
    Preparing search index...

    Function handleSearchDocuments

    • Handles the search_documents MCP tool request.

      Searches European Parliament legislative documents by keyword and optional filters, or retrieves a single document by docId. Supports filtering by document type, date range, and responsible committee. Returned document metadata includes titles, authors, status, and links to PDF/XML versions.

      Parameters

      Returns Promise<ToolResult>

      MCP tool result containing matching legislative documents or a single document

      • If args fails schema validation (e.g., keyword exceeds 200 chars, bad date format)
      • If the European Parliament API is unreachable or returns an error response
      // Full-text keyword search with filters
      const result = await handleSearchDocuments({
      keyword: 'climate change',
      documentType: 'REPORT',
      dateFrom: '2024-01-01',
      limit: 20
      });
      // Returns up to 20 EP reports matching "climate change" from 2024 onwards

      // Single document lookup by ID
      const doc = await handleSearchDocuments({ docId: 'A9-0234/2024' });
      // Returns the full metadata for document A9-0234/2024

      Input is validated with Zod before any API call. Keyword pattern is restricted to alphanumeric characters, spaces, hyphens, and underscores to prevent injection. Personal data in responses is minimised per GDPR Article 5(1)(c). All requests are rate-limited and audit-logged per ISMS Policy AU-002.

      0.8.0