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

    Sub-client for legislative procedures and adopted-texts EP API endpoints.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    baseURL: string

    European Parliament API base URL.

    cache: LRUCache<string, Record<string, unknown>>

    LRU cache for API responses.

    enableRetry: boolean

    Enable automatic retry on transient failures.

    maxResponseBytes: number

    Maximum allowed response body size in bytes.

    maxRetries: number

    Maximum number of retry attempts.

    rateLimiter: RateLimiter

    Token bucket rate limiter.

    timeoutMs: number

    Request timeout in milliseconds.

    Methods

    • Protected

      Executes a cached, rate-limited GET request to the EP API.

      Type Parameters

      • T extends Record<string, unknown>

        Expected response type (extends Record<string, unknown>)

      Parameters

      • endpoint: string

        API endpoint path (relative to baseURL)

      • Optionalparams: Record<string, unknown>

        Optional query parameters

      Returns Promise<T>

      Promise resolving to the typed API response

      On HTTP errors, network failures, or parse failures

    • Returns cache statistics for monitoring and debugging.

      Returns { hitRate: number; hits: number; maxSize: number; misses: number; size: number }

      { size, maxSize, hitRate, hits, misses }

    • Returns a single procedure by ID.

      The EP API wraps single-item responses in a JSON-LD data array, so this method extracts data[0] before transforming.

      EP API Endpoint: GET /procedures/{process-id}

      Parameters

      • processId: string

        Procedure process-id in "YYYY-NNNN" format (e.g. "2024-0006"). This is different from the human-readable Procedure.id ("COD/YYYY/NNNN") or Procedure.reference ("YYYY/NNNN(COD)") fields.

      Returns Promise<Procedure>

      When the procedure is not found (404)