# Class PlenaryClient

Sub-client for plenary sessions and meeting-related EP API endpoints.

#### Hierarchy (View Summary)

- BaseEPClient
  - PlenaryClient

- Defined in clients/ep/plenaryClient.ts:38

##### Index

### Constructors

constructor

### Properties

baseURL
cache
enableRetry
maxResponseBytes
maxRetries
rateLimiter
timeoutMs

### Methods

buildMeetingsAPIParams
clearCache
evictFromCache
get
getCacheStats
getEventById
getEvents
getEventsFeed
getMeetingActivities
getMeetingById
getMeetingDecisions
getMeetingForeseenActivities
getMeetingPlenarySessionDocumentItems
getMeetingPlenarySessionDocuments
getPlenarySessions
transformDocument
transformEvent
transformMeetingActivity
transformPlenarySession

## Constructors

### constructor

- new PlenaryClient(
  config?: EPClientConfig,
  shared?: EPSharedResources,
  ): PlenaryClient

  #### Parameters

  - config: EPClientConfig = {}
  - `Optional` shared: EPSharedResources

  #### Returns PlenaryClient

  Overrides BaseEPClient.constructor

  - Defined in clients/ep/plenaryClient.ts:39

## Properties

### `Protected` `Readonly` baseURL

baseURL: string

European Parliament API base URL.

Inherited from BaseEPClient.baseURL

- Defined in clients/ep/baseClient.ts:217

### `Protected` `Readonly` cache

cache: LRUCache<string, Record<string, unknown>>

LRU cache for API responses.

Inherited from BaseEPClient.cache

- Defined in clients/ep/baseClient.ts:215

### `Protected` `Readonly` enableRetry

enableRetry: boolean

Enable automatic retry on transient failures.

Inherited from BaseEPClient.enableRetry

- Defined in clients/ep/baseClient.ts:223

### `Protected` `Readonly` maxResponseBytes

maxResponseBytes: number

Maximum allowed response body size in bytes.

Inherited from BaseEPClient.maxResponseBytes

- Defined in clients/ep/baseClient.ts:227

### `Protected` `Readonly` maxRetries

maxRetries: number

Maximum number of retry attempts.

Inherited from BaseEPClient.maxRetries

- Defined in clients/ep/baseClient.ts:225

### `Protected` `Readonly` rateLimiter

rateLimiter: RateLimiter

Token bucket rate limiter.

Inherited from BaseEPClient.rateLimiter

- Defined in clients/ep/baseClient.ts:219

### `Protected` `Readonly` timeoutMs

timeoutMs: number

Request timeout in milliseconds.

Inherited from BaseEPClient.timeoutMs

- Defined in clients/ep/baseClient.ts:221

## Methods

### `Private` buildMeetingsAPIParams

- buildMeetingsAPIParams(
  params: {
  dateFrom?: string;
  dateTo?: string;
  limit?: number;
  offset?: number;
  year?: number;
  },
  ): Record<string, unknown>

  Maps internal params to EP API query parameters for meetings.

  The EP API `/meetings` endpoint supports `year` for filtering by calendar year. The `date-from` / `date-to` parameters are also forwarded when present (useful for sub-year ranges).

  #### Parameters

  - params: {
    dateFrom?: string;
    dateTo?: string;
    limit?: number;
    offset?: number;
    year?: number;
    }

  #### Returns Record<string, unknown>

  #### Private

  - Defined in clients/ep/plenaryClient.ts:67

### clearCache

- clearCache(): void

  Clears all entries from the LRU cache.

  #### Returns void

  Inherited from BaseEPClient.clearCache

  - Defined in clients/ep/baseClient.ts:666

### `Protected` evictFromCache

- evictFromCache(endpoint: string, params?: Record<string, unknown>): void

  Evicts a single cache entry matching the given endpoint and params. Sub-clients use this when they detect that a successfully-fetched payload is a content-pending sentinel that must not be served from cache for the remainder of the TTL — eviction lets availability recover as soon as the upstream document is enriched.

  #### Parameters

  - endpoint: string

    API endpoint path (same value passed to get)

  - `Optional` params: Record<string, unknown>

    Optional query parameters (same value passed to get)

  #### Returns void

  #### Protected

  Inherited from BaseEPClient.evictFromCache

  - Defined in clients/ep/baseClient.ts:681

### `Protected` get

- get<T extends Record<string, unknown>>(
  endpoint: string,
  params?: Record<string, unknown>,
  minimumTimeoutMs?: number,
  ): Promise<T>

  Executes a cached, rate-limited GET request to the EP API.

  #### Type Parameters

  - T extends Record<string, unknown>

    Expected response type (extends `Record<string, unknown>`)

  #### Parameters

  - endpoint: string

    API endpoint path (relative to `baseURL`)

  - `Optional` params: Record<string, unknown>

    Optional query parameters

  - `Optional` minimumTimeoutMs: number

    Optional per-request minimum timeout in milliseconds. When provided, the effective timeout is `Math.max(minimumTimeoutMs, this.timeoutMs)`, so the global timeout (set via `--timeout` or `EP_REQUEST_TIMEOUT_MS`) can still extend it beyond the per-endpoint minimum. Use for known slow EP API endpoints such as `procedures/feed`.

  #### Returns Promise<T>

  Promise resolving to the typed API response

  #### Throws

  On HTTP errors, network failures, or parse failures

  #### Protected

  Inherited from BaseEPClient.get

  - Defined in clients/ep/baseClient.ts:606

### getCacheStats

- getCacheStats(): {
  hitRate: number;
  hits: number;
  maxSize: number;
  misses: number;
  size: number;
  }

  Returns cache statistics for monitoring and debugging.

  #### Returns { hitRate: number; hits: number; maxSize: number; misses: number; size: number }

  `{ size, maxSize, hitRate, hits, misses }`

  Inherited from BaseEPClient.getCacheStats

  - Defined in clients/ep/baseClient.ts:690

### getEventById

- getEventById(eventId: string): Promise<EPEvent>

  Returns a single EP event by ID. EP API Endpoint: `GET /events/{event-id}`

  #### Parameters

  - eventId: string

  #### Returns Promise<EPEvent>

  - Defined in clients/ep/plenaryClient.ts:356

### getEvents

- getEvents(
  params?: { limit?: number; offset?: number },
  ): Promise<PaginatedResponse<EPEvent>>

  Returns EP events (hearings, conferences, etc.). EP API Endpoint: `GET /events`

  Note: The EP API `/events` endpoint does not support `year`, `date-from`, or `date-to` query parameters — it has no date filtering at all per the OpenAPI spec. Only pagination (limit/offset) is supported.

  #### Parameters

  - params: { limit?: number; offset?: number } = {}

  #### Returns Promise<PaginatedResponse<EPEvent>>

  - Defined in clients/ep/plenaryClient.ts:306

### getEventsFeed

- getEventsFeed(
  params?: {
  activityType?: string;
  startDate?: string;
  timeframe?: string;
  },
  ): Promise<JSONLDResponse<Record<string, unknown>>>

  Retrieves recently updated events via the feed endpoint. EP API Endpoint: `GET /events/feed`

  Note: The EP API `events/feed` endpoint is significantly slower than other feed endpoints. This method uses the global EP request timeout (no extended slow-feed minimum) and throws `APIError` on HTTP failures (including timeouts surfaced as status 408).

  The MCP tool layer (`handleGetEventsFeed`) converts thrown errors into a machine-readable in-band feed envelope; direct `PlenaryClient` / `EuropeanParliamentClient` consumers should handle `APIError` throws.

  #### Parameters

  - params: { activityType?: string; startDate?: string; timeframe?: string } = {}

  #### Returns Promise<JSONLDResponse<Record<string, unknown>>>

  - Defined in clients/ep/plenaryClient.ts:339

### getMeetingActivities

- getMeetingActivities(
  sittingId: string,
  params?: { limit?: number; offset?: number },
  ): Promise<PaginatedResponse<MeetingActivity>>

  Returns activities linked to a specific meeting (plenary sitting). EP API Endpoint: `GET /meetings/{sitting-id}/activities`

  #### Parameters

  - sittingId: string
  - params: { limit?: number; offset?: number } = {}

  #### Returns Promise<PaginatedResponse<MeetingActivity>>

  - Defined in clients/ep/plenaryClient.ts:147

### getMeetingById

- getMeetingById(eventId: string): Promise<PlenarySession>

  Returns a single EP meeting by ID. EP API Endpoint: `GET /meetings/{event-id}`

  #### Parameters

  - eventId: string

  #### Returns Promise<PlenarySession>

  - Defined in clients/ep/plenaryClient.ts:287

### getMeetingDecisions

- getMeetingDecisions(
  sittingId: string,
  params?: { limit?: number; offset?: number },
  ): Promise<PaginatedResponse<LegislativeDocument>>

  Returns decisions made in a specific meeting (plenary sitting). EP API Endpoint: `GET /meetings/{sitting-id}/decisions`

  #### Parameters

  - sittingId: string
  - params: { limit?: number; offset?: number } = {}

  #### Returns Promise<PaginatedResponse<LegislativeDocument>>

  - Defined in clients/ep/plenaryClient.ts:175

### getMeetingForeseenActivities

- getMeetingForeseenActivities(
  sittingId: string,
  params?: { limit?: number; offset?: number },
  ): Promise<PaginatedResponse<MeetingActivity>>

  Returns foreseen activities linked to a specific meeting. EP API Endpoint: `GET /meetings/{sitting-id}/foreseen-activities`

  #### Parameters

  - sittingId: string
  - params: { limit?: number; offset?: number } = {}

  #### Returns Promise<PaginatedResponse<MeetingActivity>>

  - Defined in clients/ep/plenaryClient.ts:203

### getMeetingPlenarySessionDocumentItems

- getMeetingPlenarySessionDocumentItems(
  sittingId: string,
  params?: { limit?: number; offset?: number },
  ): Promise<PaginatedResponse<LegislativeDocument>>

  Returns plenary session document items for a specific meeting. EP API Endpoint: `GET /meetings/{sitting-id}/plenary-session-document-items`

  #### Parameters

  - sittingId: string
  - params: { limit?: number; offset?: number } = {}

  #### Returns Promise<PaginatedResponse<LegislativeDocument>>

  - Defined in clients/ep/plenaryClient.ts:259

### getMeetingPlenarySessionDocuments

- getMeetingPlenarySessionDocuments(
  sittingId: string,
  params?: { limit?: number; offset?: number },
  ): Promise<PaginatedResponse<LegislativeDocument>>

  Returns plenary session documents for a specific meeting. EP API Endpoint: `GET /meetings/{sitting-id}/plenary-session-documents`

  #### Parameters

  - sittingId: string
  - params: { limit?: number; offset?: number } = {}

  #### Returns Promise<PaginatedResponse<LegislativeDocument>>

  - Defined in clients/ep/plenaryClient.ts:231

### getPlenarySessions

- getPlenarySessions(
  params: {
  dateFrom?: string;
  dateTo?: string;
  limit?: number;
  location?: string;
  offset?: number;
  year?: number;
  },
  ): Promise<PaginatedResponse<PlenarySession>>

  Retrieves plenary sessions with year/date and location filtering.

  EP API Endpoint: `GET /meetings`

  The EP API supports filtering by `year` (recommended for annual counts). `dateFrom` / `dateTo` are also forwarded but may be ignored by the API for certain endpoints.

  #### Parameters

  - params: {
    dateFrom?: string;
    dateTo?: string;
    limit?: number;
    location?: string;
    offset?: number;
    year?: number;
    }

    year, dateFrom, dateTo, location, limit, offset

  #### Returns Promise<PaginatedResponse<PlenarySession>>

  Paginated plenary session list

  - Defined in clients/ep/plenaryClient.ts:97

### `Private` transformDocument

- transformDocument(apiData: Record<string, unknown>): LegislativeDocument

  #### Parameters

  - apiData: Record<string, unknown>

  #### Returns LegislativeDocument

  - Defined in clients/ep/plenaryClient.ts:55

### `Private` transformEvent

- transformEvent(apiData: Record<string, unknown>): EPEvent

  #### Parameters

  - apiData: Record<string, unknown>

  #### Returns EPEvent

  - Defined in clients/ep/plenaryClient.ts:47

### `Private` transformMeetingActivity

- transformMeetingActivity(apiData: Record<string, unknown>): MeetingActivity

  #### Parameters

  - apiData: Record<string, unknown>

  #### Returns MeetingActivity

  - Defined in clients/ep/plenaryClient.ts:51

### `Private` transformPlenarySession

- transformPlenarySession(apiData: Record<string, unknown>): PlenarySession

  #### Parameters

  - apiData: Record<string, unknown>

  #### Returns PlenarySession

  - Defined in clients/ep/plenaryClient.ts:43