EU Parliament Monitor — API Documentation - v0.8.23
    Preparing search index...

    Class EuropeanParliamentMCPClient

    MCP Client for European Parliament data access. Extends MCPConnection with EP-specific tool wrapper methods.

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    safeCallTool getFailedTools getFeedHealthSummary getMEPs getPlenarySessions searchDocuments getParliamentaryQuestions getCommitteeInfo monitorLegislativePipeline analyzeLegislativeEffectiveness assessMEPInfluence analyzeCoalitionDynamics detectVotingAnomalies comparePoliticalGroups getMEPDetails getVotingRecords analyzeVotingPatterns trackLegislation generateReport analyzeCommitteeActivity trackMEPAttendance analyzeCountryDelegation generatePoliticalLandscape getCurrentMEPs getSpeeches getProcedures getAdoptedTexts getEvents getMeetingActivities getMeetingDecisions getMEPDeclarations getIncomingMEPs getOutgoingMEPs getHomonymMEPs getPlenaryDocuments getCommitteeDocuments getPlenarySessionDocuments getPlenarySessionDocumentItems getControlledVocabularies getExternalDocuments getMeetingForeseenActivities getProcedureEvents getMeetingPlenarySessionDocuments getMeetingPlenarySessionDocumentItems networkAnalysis sentimentTracker earlyWarningSystem comparativeIntelligence correlateIntelligence getAllGeneratedStats getMEPsFeed getEventsFeed getProceduresFeed getAdoptedTextsFeed getMEPDeclarationsFeed getDocumentsFeed getPlenaryDocumentsFeed getCommitteeDocumentsFeed getPlenarySessionDocumentsFeed getExternalDocumentsFeed getParliamentaryQuestionsFeed getCorporateBodiesFeed getControlledVocabulariesFeed getProcedureEventById getServerHealth isConnected isGatewayMode getGatewayUrl getGatewayApiKey getMcpSessionId getConnectionHealth connect disconnect handleMessage sendRequest listTools callTool callToolWithRetry

    Properties

    Constructors

    Methods

    • Generic error-safe wrapper around callToolWithRetry. Retries transient failures (timeouts, connection drops) with a bounded back-off delay before falling back. Non-retriable errors (session expiry, rate limits, programmer errors) are caught immediately without additional delay. Catches any error thrown by the tool (or by the args factory), logs a warning, and returns a fallback payload.

      Accepts either a plain args object or a factory function () => object. Using a factory ensures that options normalization/destructuring runs inside the try/catch so invalid runtime inputs fall back gracefully.

      Parameters

      • toolName: string

        MCP tool name

      • args: object | (() => object)

        Tool arguments or a factory that builds them

      • fallbackText: string

        JSON text to return when the tool is unavailable

      Returns Promise<MCPToolResult>

      Tool result or fallback

    • Get a summary of tools that returned fallback data in the current session. Useful for diagnosing feed availability and data quality issues.

      Returns ReadonlyMap<string, string>

      Map of tool name to error description

    • Get a human-readable feed health summary for diagnostics.

      Returns string

      Formatted summary of feed availability

    • Get detailed information about a specific MEP

      Parameters

      • id: string

        MEP identifier (must be non-empty)

      Returns Promise<MCPToolResult>

      Detailed MEP information including biography, contact, and activities

    • Track a legislative procedure by its identifier

      Parameters

      • procedureId: string

        Legislative procedure identifier (must be non-empty)

      Returns Promise<MCPToolResult>

      Procedure status and timeline

    • Retrieve precomputed European Parliament activity statistics (EP6–EP10, 2004–2025). Includes yearly stats, category rankings, political landscape history, and average-based predictions for 2026–2030. Static data refreshed weekly — no live API calls.

      Parameters

      Returns Promise<MCPToolResult>

      Precomputed EP statistics data

    • Check server health and feed availability status. Returns server version, uptime, per-feed health status, and overall availability. Does not make upstream API calls — reports cached status from recent tool invocations.

      Returns Promise<MCPToolResult>

      Server health and feed availability data

    • Get connection health metrics for telemetry

      Returns { timeoutCount: number; reconnectCount: number; connected: boolean }

      Object with timeout count, reconnection count, and current connection status

    • Send a request to the MCP server

      Type Parameters

      • T = unknown

      Parameters

      • method: string

        RPC method name

      • params: Record<string, unknown> = {}

        Method parameters

      Returns Promise<T>

      Server response

    • Call an MCP tool with automatic retry on timeout or connection loss. Reconnects automatically if the connection was lost between attempts.

      Only transient failures are retried (see isRetriableError). Non-retriable errors — rate-limit (429), session-expired (401), and programmer errors such as TypeError — are re-thrown immediately without consuming any retry budget.

      Parameters

      • name: string

        Tool name

      • args: object = {}

        Tool arguments (plain object, non-null, not an array)

      • OptionalmaxRetries: number

        Override the default retry count from options

      Returns Promise<MCPToolResult>

      Tool execution result

    Properties

    _failedTools: Map<string, string> = ...

    Tracks tools that returned fallback data in the current session

    _calledTools: Set<string> = ...

    Tracks tools that have been called (attempted) in the current session

    FEED_FALLBACK: "{\"feed\": []}" = '{"feed": []}'

    Fallback payload for feed tools

    serverLabel: string

    Human-readable server name for log messages