[**European Parliament MCP Server API v1.3.9**](../../../README.md)

***

[European Parliament MCP Server API](../../../modules.md) / [tools/monitorLegislativePipeline](../README.md) / handleMonitorLegislativePipeline

# Function: handleMonitorLegislativePipeline()

> **handleMonitorLegislativePipeline**(`args`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`ToolResult`](../../shared/types/interfaces/ToolResult.md)\>

Defined in: [tools/monitorLegislativePipeline.ts:829](https://github.com/Hack23/European-Parliament-MCP-Server/blob/main/src/tools/monitorLegislativePipeline.ts#L829)

Handles the monitor_legislative_pipeline MCP tool request.

Monitors the European Parliament's active legislative pipeline by fetching
real procedures and their authoritative event timelines from the EP API
(`/procedures` + `/procedures/{id}/events`) and computing lifecycle-driven
health metrics: percentile-based bottleneck detection, historical-median
completion forecasts, and stage-aware dwell statistics.

## Parameters

### args

`unknown`

Raw tool arguments, validated against [MonitorLegislativePipelineSchema](../../../schemas/ep/analysis/variables/MonitorLegislativePipelineSchema.md)

## Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`ToolResult`](../../shared/types/interfaces/ToolResult.md)\>

MCP tool result containing pipeline items with stage, lifecycle events,
  forecast basis, summary counts, detected bottlenecks (≥95th percentile dwell),
  pipeline health score, throughput rate, bottleneck index, and legislative momentum.

## Throws

- If `args` fails schema validation (e.g., missing required fields or invalid format)
- If the European Parliament API is unreachable for the primary procedure list

## Example

```typescript
const result = await handleMonitorLegislativePipeline({
  status: 'ACTIVE',
  committee: 'ENVI',
  dateFrom: '2024-01-01',
  dateTo: '2024-12-31',
  limit: 20
});
// Returns pipeline health score, stalled/active/completed counts,
// bottleneck list, lifecycleEvents per procedure, and forecastBasis.
```

## Security

- Input is validated with Zod before any API call.
- Personal data in responses is minimised per GDPR Article 5(1)(c).
- Bounded concurrency (≤8 parallel) on the event fan-out limits API load.
- Lifecycle corpus is cached 30 min; only event types/dates are retained.
- All requests are rate-limited and audit-logged per ISMS Policy AU-002.

## Since

0.8.0

## See

 - [monitorLegislativePipelineToolMetadata](../variables/monitorLegislativePipelineToolMetadata.md) for MCP schema registration
 - handleTrackLegislation for individual procedure stage and timeline tracking
