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

    Function handleAnalyzeVotingPatterns

    • Handles the analyze_voting_patterns MCP tool request.

      Analyses an MEP's voting behaviour over an optional date range, computing group alignment rate, cross-party voting frequency, attendance rate, and a data-quality confidence level. When compareWithGroup is true, group alignment metrics are included in the result.

      Parameters

      Returns Promise<ToolResult>

      MCP tool result containing a VotingPatternAnalysis object, or a dataAvailable: false notice when voting statistics are unavailable from the EP API

      • If args fails schema validation (e.g., missing required mepId, bad date format)
      • If the European Parliament API is unreachable or returns an error response
      const result = await handleAnalyzeVotingPatterns({
      mepId: 'MEP-124810',
      dateFrom: '2024-01-01',
      dateTo: '2024-12-31',
      compareWithGroup: true
      });
      // Returns voting statistics, group alignment, and confidence level for MEP-124810

      Input is validated with Zod before any API call. Personal data (MEP name, voting records) is minimised per GDPR Article 5(1)(c). All requests are rate-limited and audit-logged per ISMS Policy AU-002. Internal errors are wrapped before propagation to avoid leaking API details.

      0.8.0