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

    Function computeMepVotingActivityFromDoceo

    • Compute per-MEP voting activity stats from the EP DOCEO XML source.

      Fetches the latest plenary-week RCV records via doceoClient.getLatestVotes and aggregates the MEP's individual vote positions. Returns null when the DOCEO call fails (timeout, network, parse error) so the caller can fall back to placeholder data and emit a dataQualityWarning.

      Parameters

      • mepId: string

        EP MEP identifier (e.g. '197558').

      • options: ComputeMepVotingActivityOptions = {}

        Optional date range, political group, timeout and limit overrides.

      Returns Promise<DoceoMepAggregateResult | null>

      Aggregate result or null if DOCEO data is unavailable.

      Errors are audit-logged via auditLogger.logError( 'doceo_mep_aggregator.fetch', ...). Only mepId is logged (no PII).

      const result = await computeMepVotingActivityFromDoceo('197558', {
      dateFrom: '2026-01-01',
      dateTo: '2026-12-31',
      politicalGroup: 'EPP',
      });
      if (result !== null) {
      console.log(result.stats.totalVotes, result.stats.loyaltyScore);
      }