Raw tool arguments, validated against AnalyzeLegislativeEffectivenessSchema
MCP tool result with a LegislativeEffectivenessAnalysis
envelope that includes metrics, scores, per-source dataSources flags,
dataQualityWarnings, and full attribution lists sorted ascending.
const result = await handleAnalyzeLegislativeEffectiveness({
subjectType: 'MEP',
subjectId: 'person/124936',
dateFrom: '2024-01-01',
dateTo: '2024-12-31',
});
Input is validated with Zod before any API call. Per-source fetches are audit-logged with truncated counts (no MEP names beyond IDs). Per-source 6 s timeouts use AbortController to prevent dangling fetches.
Handles the
analyze_legislative_effectivenessMCP tool request.Fans out four EP Open Data Portal sources in parallel under independent 6 s timeouts, then aggregates the results through aggregateLegislativeEffectiveness to produce defensible effectiveness metrics for an MEP or committee.