euparliamentmonitor 0.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +1005 -0
- package/SECURITY.md +151 -0
- package/package.json +131 -0
- package/scripts/constants/committee-indicator-map.d.ts +199 -0
- package/scripts/constants/committee-indicator-map.d.ts.map +1 -0
- package/scripts/constants/committee-indicator-map.js +1224 -0
- package/scripts/constants/committee-indicator-map.js.map +1 -0
- package/scripts/constants/config.d.ts +38 -0
- package/scripts/constants/config.d.ts.map +1 -0
- package/scripts/constants/config.js +66 -0
- package/scripts/constants/config.js.map +1 -0
- package/scripts/constants/language-articles.d.ts +84 -0
- package/scripts/constants/language-articles.d.ts.map +1 -0
- package/scripts/constants/language-articles.js +6771 -0
- package/scripts/constants/language-articles.js.map +1 -0
- package/scripts/constants/language-core.d.ts +38 -0
- package/scripts/constants/language-core.d.ts.map +1 -0
- package/scripts/constants/language-core.js +90 -0
- package/scripts/constants/language-core.js.map +1 -0
- package/scripts/constants/language-ui.d.ts +82 -0
- package/scripts/constants/language-ui.d.ts.map +1 -0
- package/scripts/constants/language-ui.js +889 -0
- package/scripts/constants/language-ui.js.map +1 -0
- package/scripts/constants/languages.d.ts +14 -0
- package/scripts/constants/languages.d.ts.map +1 -0
- package/scripts/constants/languages.js +15 -0
- package/scripts/constants/languages.js.map +1 -0
- package/scripts/generators/analysis-builders.d.ts +266 -0
- package/scripts/generators/analysis-builders.d.ts.map +1 -0
- package/scripts/generators/analysis-builders.js +2903 -0
- package/scripts/generators/analysis-builders.js.map +1 -0
- package/scripts/generators/breaking-content.d.ts +45 -0
- package/scripts/generators/breaking-content.d.ts.map +1 -0
- package/scripts/generators/breaking-content.js +530 -0
- package/scripts/generators/breaking-content.js.map +1 -0
- package/scripts/generators/committee-helpers.d.ts +54 -0
- package/scripts/generators/committee-helpers.d.ts.map +1 -0
- package/scripts/generators/committee-helpers.js +154 -0
- package/scripts/generators/committee-helpers.js.map +1 -0
- package/scripts/generators/dashboard-content.d.ts +95 -0
- package/scripts/generators/dashboard-content.d.ts.map +1 -0
- package/scripts/generators/dashboard-content.js +630 -0
- package/scripts/generators/dashboard-content.js.map +1 -0
- package/scripts/generators/deep-analysis-content.d.ts +23 -0
- package/scripts/generators/deep-analysis-content.d.ts.map +1 -0
- package/scripts/generators/deep-analysis-content.js +831 -0
- package/scripts/generators/deep-analysis-content.js.map +1 -0
- package/scripts/generators/mindmap-content.d.ts +55 -0
- package/scripts/generators/mindmap-content.d.ts.map +1 -0
- package/scripts/generators/mindmap-content.js +512 -0
- package/scripts/generators/mindmap-content.js.map +1 -0
- package/scripts/generators/motions-content.d.ts +50 -0
- package/scripts/generators/motions-content.d.ts.map +1 -0
- package/scripts/generators/motions-content.js +391 -0
- package/scripts/generators/motions-content.js.map +1 -0
- package/scripts/generators/news-enhanced.d.ts +14 -0
- package/scripts/generators/news-enhanced.d.ts.map +1 -0
- package/scripts/generators/news-enhanced.js +169 -0
- package/scripts/generators/news-enhanced.js.map +1 -0
- package/scripts/generators/news-indexes.d.ts +31 -0
- package/scripts/generators/news-indexes.d.ts.map +1 -0
- package/scripts/generators/news-indexes.js +410 -0
- package/scripts/generators/news-indexes.js.map +1 -0
- package/scripts/generators/pipeline/fetch-stage.d.ts +352 -0
- package/scripts/generators/pipeline/fetch-stage.d.ts.map +1 -0
- package/scripts/generators/pipeline/fetch-stage.js +1522 -0
- package/scripts/generators/pipeline/fetch-stage.js.map +1 -0
- package/scripts/generators/pipeline/generate-stage.d.ts +43 -0
- package/scripts/generators/pipeline/generate-stage.d.ts.map +1 -0
- package/scripts/generators/pipeline/generate-stage.js +204 -0
- package/scripts/generators/pipeline/generate-stage.js.map +1 -0
- package/scripts/generators/pipeline/output-stage.d.ts +48 -0
- package/scripts/generators/pipeline/output-stage.d.ts.map +1 -0
- package/scripts/generators/pipeline/output-stage.js +145 -0
- package/scripts/generators/pipeline/output-stage.js.map +1 -0
- package/scripts/generators/pipeline/transform-stage.d.ts +57 -0
- package/scripts/generators/pipeline/transform-stage.d.ts.map +1 -0
- package/scripts/generators/pipeline/transform-stage.js +111 -0
- package/scripts/generators/pipeline/transform-stage.js.map +1 -0
- package/scripts/generators/propositions-content.d.ts +29 -0
- package/scripts/generators/propositions-content.d.ts.map +1 -0
- package/scripts/generators/propositions-content.js +90 -0
- package/scripts/generators/propositions-content.js.map +1 -0
- package/scripts/generators/sankey-content.d.ts +45 -0
- package/scripts/generators/sankey-content.d.ts.map +1 -0
- package/scripts/generators/sankey-content.js +227 -0
- package/scripts/generators/sankey-content.js.map +1 -0
- package/scripts/generators/sitemap.d.ts +66 -0
- package/scripts/generators/sitemap.d.ts.map +1 -0
- package/scripts/generators/sitemap.js +562 -0
- package/scripts/generators/sitemap.js.map +1 -0
- package/scripts/generators/strategies/article-strategy.d.ts +146 -0
- package/scripts/generators/strategies/article-strategy.d.ts.map +1 -0
- package/scripts/generators/strategies/article-strategy.js +4 -0
- package/scripts/generators/strategies/article-strategy.js.map +1 -0
- package/scripts/generators/strategies/breaking-news-strategy.d.ts +64 -0
- package/scripts/generators/strategies/breaking-news-strategy.d.ts.map +1 -0
- package/scripts/generators/strategies/breaking-news-strategy.js +246 -0
- package/scripts/generators/strategies/breaking-news-strategy.js.map +1 -0
- package/scripts/generators/strategies/committee-reports-strategy.d.ts +93 -0
- package/scripts/generators/strategies/committee-reports-strategy.d.ts.map +1 -0
- package/scripts/generators/strategies/committee-reports-strategy.js +447 -0
- package/scripts/generators/strategies/committee-reports-strategy.js.map +1 -0
- package/scripts/generators/strategies/month-ahead-strategy.d.ts +60 -0
- package/scripts/generators/strategies/month-ahead-strategy.d.ts.map +1 -0
- package/scripts/generators/strategies/month-ahead-strategy.js +175 -0
- package/scripts/generators/strategies/month-ahead-strategy.js.map +1 -0
- package/scripts/generators/strategies/monthly-review-strategy.d.ts +66 -0
- package/scripts/generators/strategies/monthly-review-strategy.d.ts.map +1 -0
- package/scripts/generators/strategies/monthly-review-strategy.js +204 -0
- package/scripts/generators/strategies/monthly-review-strategy.js.map +1 -0
- package/scripts/generators/strategies/motions-strategy.d.ts +61 -0
- package/scripts/generators/strategies/motions-strategy.d.ts.map +1 -0
- package/scripts/generators/strategies/motions-strategy.js +215 -0
- package/scripts/generators/strategies/motions-strategy.js.map +1 -0
- package/scripts/generators/strategies/propositions-strategy.d.ts +60 -0
- package/scripts/generators/strategies/propositions-strategy.d.ts.map +1 -0
- package/scripts/generators/strategies/propositions-strategy.js +257 -0
- package/scripts/generators/strategies/propositions-strategy.js.map +1 -0
- package/scripts/generators/strategies/week-ahead-strategy.d.ts +57 -0
- package/scripts/generators/strategies/week-ahead-strategy.d.ts.map +1 -0
- package/scripts/generators/strategies/week-ahead-strategy.js +178 -0
- package/scripts/generators/strategies/week-ahead-strategy.js.map +1 -0
- package/scripts/generators/strategies/weekly-review-strategy.d.ts +63 -0
- package/scripts/generators/strategies/weekly-review-strategy.d.ts.map +1 -0
- package/scripts/generators/strategies/weekly-review-strategy.js +211 -0
- package/scripts/generators/strategies/weekly-review-strategy.js.map +1 -0
- package/scripts/generators/swot-content.d.ts +42 -0
- package/scripts/generators/swot-content.d.ts.map +1 -0
- package/scripts/generators/swot-content.js +366 -0
- package/scripts/generators/swot-content.js.map +1 -0
- package/scripts/generators/week-ahead-content.d.ts +103 -0
- package/scripts/generators/week-ahead-content.d.ts.map +1 -0
- package/scripts/generators/week-ahead-content.js +610 -0
- package/scripts/generators/week-ahead-content.js.map +1 -0
- package/scripts/index.d.ts +40 -0
- package/scripts/index.d.ts.map +1 -0
- package/scripts/index.js +53 -0
- package/scripts/index.js.map +1 -0
- package/scripts/mcp/ep-mcp-client.d.ts +471 -0
- package/scripts/mcp/ep-mcp-client.d.ts.map +1 -0
- package/scripts/mcp/ep-mcp-client.js +734 -0
- package/scripts/mcp/ep-mcp-client.js.map +1 -0
- package/scripts/mcp/mcp-connection.d.ts +264 -0
- package/scripts/mcp/mcp-connection.d.ts.map +1 -0
- package/scripts/mcp/mcp-connection.js +790 -0
- package/scripts/mcp/mcp-connection.js.map +1 -0
- package/scripts/mcp/mcp-health.d.ts +75 -0
- package/scripts/mcp/mcp-health.d.ts.map +1 -0
- package/scripts/mcp/mcp-health.js +78 -0
- package/scripts/mcp/mcp-health.js.map +1 -0
- package/scripts/mcp/mcp-retry.d.ts +94 -0
- package/scripts/mcp/mcp-retry.d.ts.map +1 -0
- package/scripts/mcp/mcp-retry.js +127 -0
- package/scripts/mcp/mcp-retry.js.map +1 -0
- package/scripts/mcp/wb-mcp-client.d.ts +38 -0
- package/scripts/mcp/wb-mcp-client.d.ts.map +1 -0
- package/scripts/mcp/wb-mcp-client.js +112 -0
- package/scripts/mcp/wb-mcp-client.js.map +1 -0
- package/scripts/templates/article-template.d.ts +9 -0
- package/scripts/templates/article-template.d.ts.map +1 -0
- package/scripts/templates/article-template.js +378 -0
- package/scripts/templates/article-template.js.map +1 -0
- package/scripts/templates/section-builders.d.ts +28 -0
- package/scripts/templates/section-builders.d.ts.map +1 -0
- package/scripts/templates/section-builders.js +142 -0
- package/scripts/templates/section-builders.js.map +1 -0
- package/scripts/types/analysis.d.ts +115 -0
- package/scripts/types/analysis.d.ts.map +1 -0
- package/scripts/types/analysis.js +4 -0
- package/scripts/types/analysis.js.map +1 -0
- package/scripts/types/common.d.ts +584 -0
- package/scripts/types/common.d.ts.map +1 -0
- package/scripts/types/common.js +96 -0
- package/scripts/types/common.js.map +1 -0
- package/scripts/types/generation.d.ts +104 -0
- package/scripts/types/generation.d.ts.map +1 -0
- package/scripts/types/generation.js +4 -0
- package/scripts/types/generation.js.map +1 -0
- package/scripts/types/index.d.ts +24 -0
- package/scripts/types/index.d.ts.map +1 -0
- package/scripts/types/index.js +16 -0
- package/scripts/types/index.js.map +1 -0
- package/scripts/types/intelligence.d.ts +129 -0
- package/scripts/types/intelligence.d.ts.map +1 -0
- package/scripts/types/intelligence.js +4 -0
- package/scripts/types/intelligence.js.map +1 -0
- package/scripts/types/mcp.d.ts +418 -0
- package/scripts/types/mcp.d.ts.map +1 -0
- package/scripts/types/mcp.js +4 -0
- package/scripts/types/mcp.js.map +1 -0
- package/scripts/types/parliament.d.ts +388 -0
- package/scripts/types/parliament.d.ts.map +1 -0
- package/scripts/types/parliament.js +4 -0
- package/scripts/types/parliament.js.map +1 -0
- package/scripts/types/quality.d.ts +114 -0
- package/scripts/types/quality.d.ts.map +1 -0
- package/scripts/types/quality.js +4 -0
- package/scripts/types/quality.js.map +1 -0
- package/scripts/types/stakeholder.d.ts +88 -0
- package/scripts/types/stakeholder.d.ts.map +1 -0
- package/scripts/types/stakeholder.js +16 -0
- package/scripts/types/stakeholder.js.map +1 -0
- package/scripts/types/visualization.d.ts +708 -0
- package/scripts/types/visualization.d.ts.map +1 -0
- package/scripts/types/visualization.js +4 -0
- package/scripts/types/visualization.js.map +1 -0
- package/scripts/types/world-bank.d.ts +85 -0
- package/scripts/types/world-bank.d.ts.map +1 -0
- package/scripts/types/world-bank.js +4 -0
- package/scripts/types/world-bank.js.map +1 -0
- package/scripts/utils/article-category.d.ts +18 -0
- package/scripts/utils/article-category.d.ts.map +1 -0
- package/scripts/utils/article-category.js +49 -0
- package/scripts/utils/article-category.js.map +1 -0
- package/scripts/utils/article-quality-scorer.d.ts +87 -0
- package/scripts/utils/article-quality-scorer.d.ts.map +1 -0
- package/scripts/utils/article-quality-scorer.js +1048 -0
- package/scripts/utils/article-quality-scorer.js.map +1 -0
- package/scripts/utils/content-metadata.d.ts +34 -0
- package/scripts/utils/content-metadata.d.ts.map +1 -0
- package/scripts/utils/content-metadata.js +249 -0
- package/scripts/utils/content-metadata.js.map +1 -0
- package/scripts/utils/content-validator.d.ts +94 -0
- package/scripts/utils/content-validator.d.ts.map +1 -0
- package/scripts/utils/content-validator.js +489 -0
- package/scripts/utils/content-validator.js.map +1 -0
- package/scripts/utils/copy-test-reports.d.ts +9 -0
- package/scripts/utils/copy-test-reports.d.ts.map +1 -0
- package/scripts/utils/copy-test-reports.js +508 -0
- package/scripts/utils/copy-test-reports.js.map +1 -0
- package/scripts/utils/file-utils.d.ts +144 -0
- package/scripts/utils/file-utils.d.ts.map +1 -0
- package/scripts/utils/file-utils.js +374 -0
- package/scripts/utils/file-utils.js.map +1 -0
- package/scripts/utils/fix-articles.d.ts +27 -0
- package/scripts/utils/fix-articles.d.ts.map +1 -0
- package/scripts/utils/fix-articles.js +510 -0
- package/scripts/utils/fix-articles.js.map +1 -0
- package/scripts/utils/generate-docs-index.d.ts +8 -0
- package/scripts/utils/generate-docs-index.d.ts.map +1 -0
- package/scripts/utils/generate-docs-index.js +275 -0
- package/scripts/utils/generate-docs-index.js.map +1 -0
- package/scripts/utils/html-sanitize.d.ts +18 -0
- package/scripts/utils/html-sanitize.d.ts.map +1 -0
- package/scripts/utils/html-sanitize.js +57 -0
- package/scripts/utils/html-sanitize.js.map +1 -0
- package/scripts/utils/intelligence-analysis.d.ts +173 -0
- package/scripts/utils/intelligence-analysis.d.ts.map +1 -0
- package/scripts/utils/intelligence-analysis.js +936 -0
- package/scripts/utils/intelligence-analysis.js.map +1 -0
- package/scripts/utils/intelligence-index.d.ts +126 -0
- package/scripts/utils/intelligence-index.d.ts.map +1 -0
- package/scripts/utils/intelligence-index.js +731 -0
- package/scripts/utils/intelligence-index.js.map +1 -0
- package/scripts/utils/metadata-utils.d.ts +14 -0
- package/scripts/utils/metadata-utils.d.ts.map +1 -0
- package/scripts/utils/metadata-utils.js +18 -0
- package/scripts/utils/metadata-utils.js.map +1 -0
- package/scripts/utils/news-metadata.d.ts +47 -0
- package/scripts/utils/news-metadata.d.ts.map +1 -0
- package/scripts/utils/news-metadata.js +259 -0
- package/scripts/utils/news-metadata.js.map +1 -0
- package/scripts/utils/validate-articles.d.ts +2 -0
- package/scripts/utils/validate-articles.d.ts.map +1 -0
- package/scripts/utils/validate-articles.js +284 -0
- package/scripts/utils/validate-articles.js.map +1 -0
- package/scripts/utils/validate-ep-api.d.ts +51 -0
- package/scripts/utils/validate-ep-api.d.ts.map +1 -0
- package/scripts/utils/validate-ep-api.js +160 -0
- package/scripts/utils/validate-ep-api.js.map +1 -0
- package/scripts/utils/world-bank-data.d.ts +84 -0
- package/scripts/utils/world-bank-data.d.ts.map +1 -0
- package/scripts/utils/world-bank-data.js +311 -0
- package/scripts/utils/world-bank-data.js.map +1 -0
|
@@ -0,0 +1,734 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2024-2026 Hack23 AB
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
/**
|
|
4
|
+
* @module MCP/EPMCPClient
|
|
5
|
+
* @description European Parliament MCP client — domain-specific tool wrappers
|
|
6
|
+
* built on top of the generic {@link MCPConnection} transport.
|
|
7
|
+
*/
|
|
8
|
+
import { MCPConnection } from './mcp-connection.js';
|
|
9
|
+
/** Fallback payload for analyze_legislative_effectiveness when validation fails or tool is unavailable */
|
|
10
|
+
const EFFECTIVENESS_FALLBACK = '{"effectiveness": null}';
|
|
11
|
+
/** Fallback payload for MEP list tools */
|
|
12
|
+
const MEPS_FALLBACK = '{"meps": []}';
|
|
13
|
+
/** Fallback payload for document list tools */
|
|
14
|
+
const DOCUMENTS_FALLBACK = '{"documents": []}';
|
|
15
|
+
/** Fallback payload for event list tools */
|
|
16
|
+
const EVENTS_FALLBACK = '{"events": []}';
|
|
17
|
+
/** Fallback payload for activity list tools */
|
|
18
|
+
const ACTIVITIES_FALLBACK = '{"activities": []}';
|
|
19
|
+
/** Fallback payload for item list tools */
|
|
20
|
+
const ITEMS_FALLBACK = '{"items": []}';
|
|
21
|
+
/** Fallback payload for intelligence analysis tools */
|
|
22
|
+
const INTELLIGENCE_FALLBACK = '{"analysis": null}';
|
|
23
|
+
/** Fallback payload for precomputed statistics */
|
|
24
|
+
const STATS_FALLBACK = '{"stats": null}';
|
|
25
|
+
/**
|
|
26
|
+
* MCP Client for European Parliament data access.
|
|
27
|
+
* Extends {@link MCPConnection} with EP-specific tool wrapper methods.
|
|
28
|
+
*/
|
|
29
|
+
export class EuropeanParliamentMCPClient extends MCPConnection {
|
|
30
|
+
/**
|
|
31
|
+
* Generic error-safe wrapper around {@link callToolWithRetry}.
|
|
32
|
+
* Retries transient failures (timeouts, connection drops) with a bounded
|
|
33
|
+
* back-off delay before falling back. Non-retriable errors (session expiry,
|
|
34
|
+
* rate limits, programmer errors) are caught immediately without additional delay.
|
|
35
|
+
* Catches any error thrown by the tool (or by the args factory), logs a warning,
|
|
36
|
+
* and returns a fallback payload.
|
|
37
|
+
*
|
|
38
|
+
* Accepts either a plain args object or a factory function `() => object`.
|
|
39
|
+
* Using a factory ensures that options normalization/destructuring runs inside
|
|
40
|
+
* the try/catch so invalid runtime inputs fall back gracefully.
|
|
41
|
+
*
|
|
42
|
+
* @param toolName - MCP tool name
|
|
43
|
+
* @param args - Tool arguments or a factory that builds them
|
|
44
|
+
* @param fallbackText - JSON text to return when the tool is unavailable
|
|
45
|
+
* @returns Tool result or fallback
|
|
46
|
+
*/
|
|
47
|
+
async safeCallTool(toolName, args, fallbackText) {
|
|
48
|
+
try {
|
|
49
|
+
const resolvedArgs = typeof args === 'function' ? args() : args;
|
|
50
|
+
return await this.callToolWithRetry(toolName, resolvedArgs);
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
54
|
+
console.warn(`${toolName} not available:`, message);
|
|
55
|
+
return { content: [{ type: 'text', text: fallbackText }] };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Get Members of European Parliament
|
|
60
|
+
*
|
|
61
|
+
* @param options - Filter options
|
|
62
|
+
* @returns List of MEPs
|
|
63
|
+
*/
|
|
64
|
+
async getMEPs(options = {}) {
|
|
65
|
+
return this.safeCallTool('get_meps', options, MEPS_FALLBACK);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Get plenary sessions
|
|
69
|
+
*
|
|
70
|
+
* @param options - Filter options. `dateFrom` is mapped to `startDate` and `dateTo` to `endDate`
|
|
71
|
+
* per the tool schema when the canonical fields are absent.
|
|
72
|
+
* @returns Plenary sessions data
|
|
73
|
+
*/
|
|
74
|
+
async getPlenarySessions(options = {}) {
|
|
75
|
+
return this.safeCallTool('get_plenary_sessions', () => {
|
|
76
|
+
const { dateFrom, dateTo, ...rest } = options;
|
|
77
|
+
const normalizedOptions = { ...rest };
|
|
78
|
+
if (normalizedOptions['startDate'] === undefined && dateFrom !== undefined) {
|
|
79
|
+
normalizedOptions['startDate'] = dateFrom;
|
|
80
|
+
}
|
|
81
|
+
if (normalizedOptions['endDate'] === undefined && dateTo !== undefined) {
|
|
82
|
+
normalizedOptions['endDate'] = dateTo;
|
|
83
|
+
}
|
|
84
|
+
return normalizedOptions;
|
|
85
|
+
}, '{"sessions": []}');
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Search legislative documents
|
|
89
|
+
*
|
|
90
|
+
* @param options - Search options (normalizes `query` to `keyword` if `keyword` is absent,
|
|
91
|
+
* since the MCP tool schema requires the `keyword` parameter)
|
|
92
|
+
* @returns Search results
|
|
93
|
+
*/
|
|
94
|
+
async searchDocuments(options = {}) {
|
|
95
|
+
return this.safeCallTool('search_documents', () => {
|
|
96
|
+
const { query, ...rest } = options;
|
|
97
|
+
const normalizedOptions = { ...rest };
|
|
98
|
+
// MCP tool schema expects 'keyword', not 'query'
|
|
99
|
+
if (normalizedOptions['keyword'] === undefined && query !== undefined) {
|
|
100
|
+
const trimmed = String(query).trim();
|
|
101
|
+
if (trimmed.length > 0) {
|
|
102
|
+
normalizedOptions['keyword'] = trimmed;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return normalizedOptions;
|
|
106
|
+
}, DOCUMENTS_FALLBACK);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Get parliamentary questions
|
|
110
|
+
*
|
|
111
|
+
* @param options - Filter options. `dateFrom` is mapped to `startDate` per the tool schema.
|
|
112
|
+
* `dateTo` is intentionally ignored because the `get_parliamentary_questions` tool schema
|
|
113
|
+
* only supports `startDate` as a date filter; passing `dateTo` would have no effect.
|
|
114
|
+
* @returns Parliamentary questions data
|
|
115
|
+
*/
|
|
116
|
+
async getParliamentaryQuestions(options = {}) {
|
|
117
|
+
return this.safeCallTool('get_parliamentary_questions', () => {
|
|
118
|
+
const { dateFrom, dateTo: _dateTo, ...rest } = options;
|
|
119
|
+
const toolOptions = { ...rest };
|
|
120
|
+
if (toolOptions['startDate'] === undefined && dateFrom !== undefined) {
|
|
121
|
+
toolOptions['startDate'] = dateFrom;
|
|
122
|
+
}
|
|
123
|
+
return toolOptions;
|
|
124
|
+
}, '{"questions": []}');
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Get committee information
|
|
128
|
+
*
|
|
129
|
+
* @param options - Filter options
|
|
130
|
+
* @returns Committee info data
|
|
131
|
+
*/
|
|
132
|
+
async getCommitteeInfo(options = {}) {
|
|
133
|
+
return this.safeCallTool('get_committee_info', () => {
|
|
134
|
+
const { committeeId, ...rest } = options;
|
|
135
|
+
const toolOptions = { ...rest };
|
|
136
|
+
// MCP tool schema expects 'abbreviation', not 'committeeId'
|
|
137
|
+
if (toolOptions['abbreviation'] === undefined && committeeId !== undefined) {
|
|
138
|
+
toolOptions['abbreviation'] = committeeId;
|
|
139
|
+
}
|
|
140
|
+
return toolOptions;
|
|
141
|
+
}, '{"committees": []}');
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Monitor legislative pipeline
|
|
145
|
+
*
|
|
146
|
+
* @param options - Filter options
|
|
147
|
+
* @returns Legislative pipeline data
|
|
148
|
+
*/
|
|
149
|
+
async monitorLegislativePipeline(options = {}) {
|
|
150
|
+
return this.safeCallTool('monitor_legislative_pipeline', options, '{"procedures": []}');
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Analyze legislative effectiveness of an MEP or committee
|
|
154
|
+
*
|
|
155
|
+
* @param options - Options including subjectType and subjectId
|
|
156
|
+
* @returns Legislative effectiveness data
|
|
157
|
+
*/
|
|
158
|
+
async analyzeLegislativeEffectiveness(options) {
|
|
159
|
+
const { subjectType, subjectId } = options;
|
|
160
|
+
if (subjectId.trim().length === 0) {
|
|
161
|
+
console.warn('analyze_legislative_effectiveness called without valid subjectId (non-empty string required)');
|
|
162
|
+
return { content: [{ type: 'text', text: EFFECTIVENESS_FALLBACK }] };
|
|
163
|
+
}
|
|
164
|
+
const trimmedSubjectId = subjectId.trim();
|
|
165
|
+
return this.safeCallTool('analyze_legislative_effectiveness', { ...options, subjectType, subjectId: trimmedSubjectId }, EFFECTIVENESS_FALLBACK);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Assess MEP influence using 5-dimension scoring model
|
|
169
|
+
*
|
|
170
|
+
* @param options - Options including required mepId and optional date range
|
|
171
|
+
* @returns MEP influence score and breakdown
|
|
172
|
+
*/
|
|
173
|
+
async assessMEPInfluence(options) {
|
|
174
|
+
const trimmedMepId = options && typeof options.mepId === 'string' ? options.mepId.trim() : '';
|
|
175
|
+
if (trimmedMepId.length === 0) {
|
|
176
|
+
console.warn('assess_mep_influence called without valid mepId (non-empty string required)');
|
|
177
|
+
return { content: [{ type: 'text', text: '{"influence": {}}' }] };
|
|
178
|
+
}
|
|
179
|
+
return this.safeCallTool('assess_mep_influence', { ...options, mepId: trimmedMepId }, '{"influence": {}}');
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Analyze coalition dynamics and cohesion
|
|
183
|
+
*
|
|
184
|
+
* @param options - Options including optional political groups and date range
|
|
185
|
+
* @returns Coalition cohesion and stress analysis
|
|
186
|
+
*/
|
|
187
|
+
async analyzeCoalitionDynamics(options = {}) {
|
|
188
|
+
return this.safeCallTool('analyze_coalition_dynamics', options, '{"coalitions": []}');
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Detect voting anomalies and party defections
|
|
192
|
+
*
|
|
193
|
+
* @param options - Options including optional MEP id, political group, and date
|
|
194
|
+
* @returns Anomaly detection results
|
|
195
|
+
*/
|
|
196
|
+
async detectVotingAnomalies(options = {}) {
|
|
197
|
+
return this.safeCallTool('detect_voting_anomalies', options, '{"anomalies": []}');
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Compare political groups across dimensions
|
|
201
|
+
*
|
|
202
|
+
* @param options - Options including required groups and optional metrics and date
|
|
203
|
+
* @returns Cross-group comparative analysis
|
|
204
|
+
*/
|
|
205
|
+
async comparePoliticalGroups(options) {
|
|
206
|
+
const rawGroups = options && Array.isArray(options.groups) ? options.groups : [];
|
|
207
|
+
const groups = rawGroups
|
|
208
|
+
.map((g) => (typeof g === 'string' ? g.trim() : ''))
|
|
209
|
+
.filter((g) => g.length > 0);
|
|
210
|
+
if (groups.length === 0) {
|
|
211
|
+
console.warn('compare_political_groups called without valid groups (non-empty string array required)');
|
|
212
|
+
return { content: [{ type: 'text', text: '{"comparison": {}}' }] };
|
|
213
|
+
}
|
|
214
|
+
return this.safeCallTool('compare_political_groups', { ...options, groups }, '{"comparison": {}}');
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Get detailed information about a specific MEP
|
|
218
|
+
*
|
|
219
|
+
* @param id - MEP identifier (must be non-empty)
|
|
220
|
+
* @returns Detailed MEP information including biography, contact, and activities
|
|
221
|
+
*/
|
|
222
|
+
async getMEPDetails(id) {
|
|
223
|
+
if (typeof id !== 'string' || id.trim().length === 0) {
|
|
224
|
+
console.warn('get_mep_details called without valid id (non-empty string required)');
|
|
225
|
+
return { content: [{ type: 'text', text: '{"mep": null}' }] };
|
|
226
|
+
}
|
|
227
|
+
return this.safeCallTool('get_mep_details', { id: id.trim() }, '{"mep": null}');
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Retrieve voting records with optional filters
|
|
231
|
+
*
|
|
232
|
+
* @param options - Filter options (mepId, sessionId, limit)
|
|
233
|
+
* @returns Voting records data
|
|
234
|
+
*/
|
|
235
|
+
async getVotingRecords(options = {}) {
|
|
236
|
+
return this.safeCallTool('get_voting_records', options, '{"votes": []}');
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Analyze voting behavior patterns for an MEP
|
|
240
|
+
*
|
|
241
|
+
* @param options - Analysis options (mepId required non-empty, dateFrom, compareWithGroup)
|
|
242
|
+
* @returns Voting pattern analysis
|
|
243
|
+
*/
|
|
244
|
+
async analyzeVotingPatterns(options) {
|
|
245
|
+
if (typeof options.mepId !== 'string' || options.mepId.trim().length === 0) {
|
|
246
|
+
console.warn('analyze_voting_patterns called without valid mepId (non-empty string required)');
|
|
247
|
+
return { content: [{ type: 'text', text: '{"patterns": null}' }] };
|
|
248
|
+
}
|
|
249
|
+
return this.safeCallTool('analyze_voting_patterns', { ...options, mepId: options.mepId.trim() }, '{"patterns": null}');
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Track a legislative procedure by its identifier
|
|
253
|
+
*
|
|
254
|
+
* @param procedureId - Legislative procedure identifier (must be non-empty)
|
|
255
|
+
* @returns Procedure status and timeline
|
|
256
|
+
*/
|
|
257
|
+
async trackLegislation(procedureId) {
|
|
258
|
+
if (typeof procedureId !== 'string' || procedureId.trim().length === 0) {
|
|
259
|
+
console.warn('track_legislation called without valid procedureId (non-empty string required)');
|
|
260
|
+
return { content: [{ type: 'text', text: '{"procedure": null}' }] };
|
|
261
|
+
}
|
|
262
|
+
return this.safeCallTool('track_legislation', { procedureId: procedureId.trim() }, '{"procedure": null}');
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Generate an analytical report
|
|
266
|
+
*
|
|
267
|
+
* @param options - Report options (reportType required non-empty, subjectId, dateFrom)
|
|
268
|
+
* @returns Generated report data
|
|
269
|
+
*/
|
|
270
|
+
async generateReport(options) {
|
|
271
|
+
if (typeof options.reportType !== 'string' || options.reportType.trim().length === 0) {
|
|
272
|
+
console.warn('generate_report called without valid reportType (non-empty string required)');
|
|
273
|
+
return { content: [{ type: 'text', text: '{"report": null}' }] };
|
|
274
|
+
}
|
|
275
|
+
return this.safeCallTool('generate_report', { ...options, reportType: options.reportType.trim() }, '{"report": null}');
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Analyze committee activity, workload, and engagement
|
|
279
|
+
*
|
|
280
|
+
* @param options - Options including optional committeeId and date range
|
|
281
|
+
* @returns Committee activity analysis data
|
|
282
|
+
*/
|
|
283
|
+
async analyzeCommitteeActivity(options = {}) {
|
|
284
|
+
return this.safeCallTool('analyze_committee_activity', options, '{"activity": null}');
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Track MEP attendance patterns and trends
|
|
288
|
+
*
|
|
289
|
+
* @param options - Options including optional mepId and date range
|
|
290
|
+
* @returns MEP attendance data
|
|
291
|
+
*/
|
|
292
|
+
async trackMEPAttendance(options = {}) {
|
|
293
|
+
return this.safeCallTool('track_mep_attendance', options, '{"attendance": null}');
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Analyze country delegation voting behavior and composition
|
|
297
|
+
*
|
|
298
|
+
* @param options - Options including required country code and optional date range
|
|
299
|
+
* @returns Country delegation analysis data
|
|
300
|
+
*/
|
|
301
|
+
async analyzeCountryDelegation(options) {
|
|
302
|
+
if (typeof options.country !== 'string' || options.country.trim().length === 0) {
|
|
303
|
+
console.warn('analyze_country_delegation called without valid country (non-empty string required)');
|
|
304
|
+
return { content: [{ type: 'text', text: '{"delegation": null}' }] };
|
|
305
|
+
}
|
|
306
|
+
return this.safeCallTool('analyze_country_delegation', { ...options, country: options.country.trim() }, '{"delegation": null}');
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Generate a parliament-wide political landscape overview
|
|
310
|
+
*
|
|
311
|
+
* @param options - Options including optional date range and detail level
|
|
312
|
+
* @returns Political landscape overview data
|
|
313
|
+
*/
|
|
314
|
+
async generatePoliticalLandscape(options = {}) {
|
|
315
|
+
return this.safeCallTool('generate_political_landscape', options, '{"landscape": null}');
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Get currently active Members of European Parliament
|
|
319
|
+
*
|
|
320
|
+
* @param options - Pagination options
|
|
321
|
+
* @returns Active MEPs data
|
|
322
|
+
*/
|
|
323
|
+
async getCurrentMEPs(options = {}) {
|
|
324
|
+
return this.safeCallTool('get_current_meps', options, MEPS_FALLBACK);
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Get plenary speeches and debate contributions
|
|
328
|
+
*
|
|
329
|
+
* @param options - Filter options including optional speechId or date range
|
|
330
|
+
* @returns Speeches data
|
|
331
|
+
*/
|
|
332
|
+
async getSpeeches(options = {}) {
|
|
333
|
+
return this.safeCallTool('get_speeches', options, '{"speeches": []}');
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Get legislative procedures
|
|
337
|
+
*
|
|
338
|
+
* @param options - Filter options including optional processId or year
|
|
339
|
+
* @returns Procedures data
|
|
340
|
+
*/
|
|
341
|
+
async getProcedures(options = {}) {
|
|
342
|
+
return this.safeCallTool('get_procedures', options, '{"procedures": []}');
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Get adopted texts (legislative resolutions, positions, non-legislative resolutions)
|
|
346
|
+
*
|
|
347
|
+
* @param options - Filter options including optional docId or year
|
|
348
|
+
* @returns Adopted texts data
|
|
349
|
+
*/
|
|
350
|
+
async getAdoptedTexts(options = {}) {
|
|
351
|
+
return this.safeCallTool('get_adopted_texts', options, '{"texts": []}');
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Get European Parliament events (hearings, conferences, seminars)
|
|
355
|
+
*
|
|
356
|
+
* @param options - Filter options including optional eventId or date range
|
|
357
|
+
* @returns Events data
|
|
358
|
+
*/
|
|
359
|
+
async getEvents(options = {}) {
|
|
360
|
+
return this.safeCallTool('get_events', options, EVENTS_FALLBACK);
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Get activities linked to a specific plenary sitting
|
|
364
|
+
*
|
|
365
|
+
* @param options - Options including required sittingId
|
|
366
|
+
* @returns Meeting activities data
|
|
367
|
+
*/
|
|
368
|
+
async getMeetingActivities(options) {
|
|
369
|
+
if (typeof options.sittingId !== 'string' || options.sittingId.trim().length === 0) {
|
|
370
|
+
console.warn('get_meeting_activities called without valid sittingId (non-empty string required)');
|
|
371
|
+
return { content: [{ type: 'text', text: ACTIVITIES_FALLBACK }] };
|
|
372
|
+
}
|
|
373
|
+
return this.safeCallTool('get_meeting_activities', { ...options, sittingId: options.sittingId.trim() }, ACTIVITIES_FALLBACK);
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Get decisions made in a specific plenary sitting
|
|
377
|
+
*
|
|
378
|
+
* @param options - Options including required sittingId
|
|
379
|
+
* @returns Meeting decisions data
|
|
380
|
+
*/
|
|
381
|
+
async getMeetingDecisions(options) {
|
|
382
|
+
if (typeof options.sittingId !== 'string' || options.sittingId.trim().length === 0) {
|
|
383
|
+
console.warn('get_meeting_decisions called without valid sittingId (non-empty string required)');
|
|
384
|
+
return { content: [{ type: 'text', text: '{"decisions": []}' }] };
|
|
385
|
+
}
|
|
386
|
+
return this.safeCallTool('get_meeting_decisions', { ...options, sittingId: options.sittingId.trim() }, '{"decisions": []}');
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Get MEP declarations of financial interests
|
|
390
|
+
*
|
|
391
|
+
* @param options - Filter options including optional docId or year
|
|
392
|
+
* @returns MEP declarations data
|
|
393
|
+
*/
|
|
394
|
+
async getMEPDeclarations(options = {}) {
|
|
395
|
+
return this.safeCallTool('get_mep_declarations', options, '{"declarations": []}');
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Get incoming Members of European Parliament
|
|
399
|
+
*
|
|
400
|
+
* @param options - Pagination options
|
|
401
|
+
* @returns Incoming MEPs data
|
|
402
|
+
*/
|
|
403
|
+
async getIncomingMEPs(options = {}) {
|
|
404
|
+
return this.safeCallTool('get_incoming_meps', options, MEPS_FALLBACK);
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Get outgoing Members of European Parliament
|
|
408
|
+
*
|
|
409
|
+
* @param options - Pagination options
|
|
410
|
+
* @returns Outgoing MEPs data
|
|
411
|
+
*/
|
|
412
|
+
async getOutgoingMEPs(options = {}) {
|
|
413
|
+
return this.safeCallTool('get_outgoing_meps', options, MEPS_FALLBACK);
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Get homonym MEPs (MEPs with identical names)
|
|
417
|
+
*
|
|
418
|
+
* @param options - Pagination options
|
|
419
|
+
* @returns Homonym MEPs data
|
|
420
|
+
*/
|
|
421
|
+
async getHomonymMEPs(options = {}) {
|
|
422
|
+
return this.safeCallTool('get_homonym_meps', options, MEPS_FALLBACK);
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Get plenary documents
|
|
426
|
+
*
|
|
427
|
+
* @param options - Filter options including optional docId or year
|
|
428
|
+
* @returns Plenary documents data
|
|
429
|
+
*/
|
|
430
|
+
async getPlenaryDocuments(options = {}) {
|
|
431
|
+
return this.safeCallTool('get_plenary_documents', options, DOCUMENTS_FALLBACK);
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Get committee documents
|
|
435
|
+
*
|
|
436
|
+
* @param options - Filter options including optional docId or year
|
|
437
|
+
* @returns Committee documents data
|
|
438
|
+
*/
|
|
439
|
+
async getCommitteeDocuments(options = {}) {
|
|
440
|
+
return this.safeCallTool('get_committee_documents', options, DOCUMENTS_FALLBACK);
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Get plenary session documents (agendas, minutes, voting lists)
|
|
444
|
+
*
|
|
445
|
+
* @param options - Filter options including optional docId
|
|
446
|
+
* @returns Plenary session documents data
|
|
447
|
+
*/
|
|
448
|
+
async getPlenarySessionDocuments(options = {}) {
|
|
449
|
+
return this.safeCallTool('get_plenary_session_documents', options, DOCUMENTS_FALLBACK);
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Get plenary session document items
|
|
453
|
+
*
|
|
454
|
+
* @param options - Pagination options
|
|
455
|
+
* @returns Plenary session document items data
|
|
456
|
+
*/
|
|
457
|
+
async getPlenarySessionDocumentItems(options = {}) {
|
|
458
|
+
return this.safeCallTool('get_plenary_session_document_items', options, ITEMS_FALLBACK);
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Get controlled vocabularies (standardized classification terms)
|
|
462
|
+
*
|
|
463
|
+
* @param options - Filter options including optional vocId
|
|
464
|
+
* @returns Controlled vocabularies data
|
|
465
|
+
*/
|
|
466
|
+
async getControlledVocabularies(options = {}) {
|
|
467
|
+
return this.safeCallTool('get_controlled_vocabularies', options, '{"vocabularies": []}');
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Get external documents (non-EP documents such as Council positions)
|
|
471
|
+
*
|
|
472
|
+
* @param options - Filter options including optional docId or year
|
|
473
|
+
* @returns External documents data
|
|
474
|
+
*/
|
|
475
|
+
async getExternalDocuments(options = {}) {
|
|
476
|
+
return this.safeCallTool('get_external_documents', options, DOCUMENTS_FALLBACK);
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* Get foreseen (planned) activities for a specific plenary sitting
|
|
480
|
+
*
|
|
481
|
+
* @param options - Options including required sittingId
|
|
482
|
+
* @returns Foreseen activities data
|
|
483
|
+
*/
|
|
484
|
+
async getMeetingForeseenActivities(options) {
|
|
485
|
+
if (typeof options.sittingId !== 'string' || options.sittingId.trim().length === 0) {
|
|
486
|
+
console.warn('get_meeting_foreseen_activities called without valid sittingId (non-empty string required)');
|
|
487
|
+
return { content: [{ type: 'text', text: ACTIVITIES_FALLBACK }] };
|
|
488
|
+
}
|
|
489
|
+
return this.safeCallTool('get_meeting_foreseen_activities', { ...options, sittingId: options.sittingId.trim() }, ACTIVITIES_FALLBACK);
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* Get events linked to a specific legislative procedure
|
|
493
|
+
*
|
|
494
|
+
* @param options - Options including required processId
|
|
495
|
+
* @returns Procedure events data
|
|
496
|
+
*/
|
|
497
|
+
async getProcedureEvents(options) {
|
|
498
|
+
if (typeof options.processId !== 'string' || options.processId.trim().length === 0) {
|
|
499
|
+
console.warn('get_procedure_events called without valid processId (non-empty string required)');
|
|
500
|
+
return { content: [{ type: 'text', text: EVENTS_FALLBACK }] };
|
|
501
|
+
}
|
|
502
|
+
return this.safeCallTool('get_procedure_events', { ...options, processId: options.processId.trim() }, EVENTS_FALLBACK);
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Get plenary session documents linked to a specific meeting
|
|
506
|
+
*
|
|
507
|
+
* @param options - Options including required sittingId
|
|
508
|
+
* @returns Meeting plenary session documents data
|
|
509
|
+
*/
|
|
510
|
+
async getMeetingPlenarySessionDocuments(options) {
|
|
511
|
+
if (typeof options.sittingId !== 'string' || options.sittingId.trim().length === 0) {
|
|
512
|
+
console.warn('get_meeting_plenary_session_documents called without valid sittingId (non-empty string required)');
|
|
513
|
+
return { content: [{ type: 'text', text: DOCUMENTS_FALLBACK }] };
|
|
514
|
+
}
|
|
515
|
+
return this.safeCallTool('get_meeting_plenary_session_documents', { ...options, sittingId: options.sittingId.trim() }, DOCUMENTS_FALLBACK);
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Get plenary session document items linked to a specific meeting
|
|
519
|
+
*
|
|
520
|
+
* @param options - Options including required sittingId
|
|
521
|
+
* @returns Meeting plenary session document items data
|
|
522
|
+
*/
|
|
523
|
+
async getMeetingPlenarySessionDocumentItems(options) {
|
|
524
|
+
if (typeof options.sittingId !== 'string' || options.sittingId.trim().length === 0) {
|
|
525
|
+
console.warn('get_meeting_plenary_session_document_items called without valid sittingId (non-empty string required)');
|
|
526
|
+
return { content: [{ type: 'text', text: ITEMS_FALLBACK }] };
|
|
527
|
+
}
|
|
528
|
+
return this.safeCallTool('get_meeting_plenary_session_document_items', { ...options, sittingId: options.sittingId.trim() }, ITEMS_FALLBACK);
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* MEP relationship network mapping using committee co-membership
|
|
532
|
+
*
|
|
533
|
+
* @param options - Options including optional mepId, analysisType, and depth
|
|
534
|
+
* @returns Network analysis with centrality scores and clusters
|
|
535
|
+
*/
|
|
536
|
+
async networkAnalysis(options = {}) {
|
|
537
|
+
return this.safeCallTool('network_analysis', options, INTELLIGENCE_FALLBACK);
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* Track political group institutional positioning and sentiment
|
|
541
|
+
*
|
|
542
|
+
* @param options - Options including optional groupId and timeframe
|
|
543
|
+
* @returns Sentiment tracking data
|
|
544
|
+
*/
|
|
545
|
+
async sentimentTracker(options = {}) {
|
|
546
|
+
return this.safeCallTool('sentiment_tracker', options, INTELLIGENCE_FALLBACK);
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* Detect emerging political shifts and coalition fracture signals
|
|
550
|
+
*
|
|
551
|
+
* @param options - Options including optional sensitivity and focusArea
|
|
552
|
+
* @returns Early warning alerts and trend indicators
|
|
553
|
+
*/
|
|
554
|
+
async earlyWarningSystem(options = {}) {
|
|
555
|
+
return this.safeCallTool('early_warning_system', options, INTELLIGENCE_FALLBACK);
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* Cross-reference MEP activities for comparative multi-dimensional profiling
|
|
559
|
+
*
|
|
560
|
+
* @param options - Options including required mepIds array and optional dimensions
|
|
561
|
+
* @returns Comparative intelligence profiles
|
|
562
|
+
*/
|
|
563
|
+
async comparativeIntelligence(options) {
|
|
564
|
+
if (!Array.isArray(options.mepIds) || options.mepIds.length < 2) {
|
|
565
|
+
console.warn('comparative_intelligence called without valid mepIds (array of at least 2 required)');
|
|
566
|
+
return { content: [{ type: 'text', text: INTELLIGENCE_FALLBACK }] };
|
|
567
|
+
}
|
|
568
|
+
return this.safeCallTool('comparative_intelligence', options, INTELLIGENCE_FALLBACK);
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Cross-tool OSINT intelligence correlation engine
|
|
572
|
+
*
|
|
573
|
+
* @param options - Options including optional mepId and correlation scenarios
|
|
574
|
+
* @returns Correlated intelligence alerts and insights
|
|
575
|
+
*/
|
|
576
|
+
async correlateIntelligence(options = {}) {
|
|
577
|
+
return this.safeCallTool('correlate_intelligence', options, INTELLIGENCE_FALLBACK);
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* Retrieve precomputed European Parliament activity statistics (EP6–EP10, 2004–2025).
|
|
581
|
+
* Includes yearly stats, category rankings, political landscape history, and
|
|
582
|
+
* average-based predictions for 2026–2030. Static data refreshed weekly — no live API calls.
|
|
583
|
+
*
|
|
584
|
+
* @param options - Filter options including optional year range, category, and flags
|
|
585
|
+
* @returns Precomputed EP statistics data
|
|
586
|
+
*/
|
|
587
|
+
async getAllGeneratedStats(options = {}) {
|
|
588
|
+
return this.safeCallTool('get_all_generated_stats', options, STATS_FALLBACK);
|
|
589
|
+
}
|
|
590
|
+
// ─── EP API v2 Feed Endpoint Methods ────────────────────────────────────────
|
|
591
|
+
/** Fallback payload for feed tools */
|
|
592
|
+
static FEED_FALLBACK = '{"feed": []}';
|
|
593
|
+
/**
|
|
594
|
+
* Get MEPs feed (most recent updates via EP API v2)
|
|
595
|
+
*
|
|
596
|
+
* @param options - Pagination options
|
|
597
|
+
* @returns MEPs feed data
|
|
598
|
+
*/
|
|
599
|
+
async getMEPsFeed(options = {}) {
|
|
600
|
+
return this.safeCallTool('get_meps_feed', options, EuropeanParliamentMCPClient.FEED_FALLBACK);
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* Get events feed (most recent updates via EP API v2)
|
|
604
|
+
*
|
|
605
|
+
* @param options - Pagination options
|
|
606
|
+
* @returns Events feed data
|
|
607
|
+
*/
|
|
608
|
+
async getEventsFeed(options = {}) {
|
|
609
|
+
return this.safeCallTool('get_events_feed', options, EuropeanParliamentMCPClient.FEED_FALLBACK);
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* Get procedures feed (most recent updates via EP API v2)
|
|
613
|
+
*
|
|
614
|
+
* @param options - Pagination options
|
|
615
|
+
* @returns Procedures feed data
|
|
616
|
+
*/
|
|
617
|
+
async getProceduresFeed(options = {}) {
|
|
618
|
+
return this.safeCallTool('get_procedures_feed', options, EuropeanParliamentMCPClient.FEED_FALLBACK);
|
|
619
|
+
}
|
|
620
|
+
/**
|
|
621
|
+
* Get adopted texts feed (most recent updates via EP API v2)
|
|
622
|
+
*
|
|
623
|
+
* @param options - Pagination options
|
|
624
|
+
* @returns Adopted texts feed data
|
|
625
|
+
*/
|
|
626
|
+
async getAdoptedTextsFeed(options = {}) {
|
|
627
|
+
return this.safeCallTool('get_adopted_texts_feed', options, EuropeanParliamentMCPClient.FEED_FALLBACK);
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* Get MEP declarations feed (most recent updates via EP API v2)
|
|
631
|
+
*
|
|
632
|
+
* @param options - Pagination options
|
|
633
|
+
* @returns MEP declarations feed data
|
|
634
|
+
*/
|
|
635
|
+
async getMEPDeclarationsFeed(options = {}) {
|
|
636
|
+
return this.safeCallTool('get_mep_declarations_feed', options, EuropeanParliamentMCPClient.FEED_FALLBACK);
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* Get documents feed (most recent updates via EP API v2)
|
|
640
|
+
*
|
|
641
|
+
* @param options - Pagination options
|
|
642
|
+
* @returns Documents feed data
|
|
643
|
+
*/
|
|
644
|
+
async getDocumentsFeed(options = {}) {
|
|
645
|
+
return this.safeCallTool('get_documents_feed', options, EuropeanParliamentMCPClient.FEED_FALLBACK);
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* Get plenary documents feed (most recent updates via EP API v2)
|
|
649
|
+
*
|
|
650
|
+
* @param options - Pagination options
|
|
651
|
+
* @returns Plenary documents feed data
|
|
652
|
+
*/
|
|
653
|
+
async getPlenaryDocumentsFeed(options = {}) {
|
|
654
|
+
return this.safeCallTool('get_plenary_documents_feed', options, EuropeanParliamentMCPClient.FEED_FALLBACK);
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* Get committee documents feed (most recent updates via EP API v2)
|
|
658
|
+
*
|
|
659
|
+
* @param options - Pagination options
|
|
660
|
+
* @returns Committee documents feed data
|
|
661
|
+
*/
|
|
662
|
+
async getCommitteeDocumentsFeed(options = {}) {
|
|
663
|
+
return this.safeCallTool('get_committee_documents_feed', options, EuropeanParliamentMCPClient.FEED_FALLBACK);
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* Get plenary session documents feed (most recent updates via EP API v2)
|
|
667
|
+
*
|
|
668
|
+
* @param options - Pagination options
|
|
669
|
+
* @returns Plenary session documents feed data
|
|
670
|
+
*/
|
|
671
|
+
async getPlenarySessionDocumentsFeed(options = {}) {
|
|
672
|
+
return this.safeCallTool('get_plenary_session_documents_feed', options, EuropeanParliamentMCPClient.FEED_FALLBACK);
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* Get external documents feed (most recent updates via EP API v2)
|
|
676
|
+
*
|
|
677
|
+
* @param options - Pagination options
|
|
678
|
+
* @returns External documents feed data
|
|
679
|
+
*/
|
|
680
|
+
async getExternalDocumentsFeed(options = {}) {
|
|
681
|
+
return this.safeCallTool('get_external_documents_feed', options, EuropeanParliamentMCPClient.FEED_FALLBACK);
|
|
682
|
+
}
|
|
683
|
+
/**
|
|
684
|
+
* Get parliamentary questions feed (most recent updates via EP API v2)
|
|
685
|
+
*
|
|
686
|
+
* @param options - Pagination options
|
|
687
|
+
* @returns Parliamentary questions feed data
|
|
688
|
+
*/
|
|
689
|
+
async getParliamentaryQuestionsFeed(options = {}) {
|
|
690
|
+
return this.safeCallTool('get_parliamentary_questions_feed', options, EuropeanParliamentMCPClient.FEED_FALLBACK);
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* Get corporate bodies feed (most recent updates via EP API v2)
|
|
694
|
+
*
|
|
695
|
+
* @param options - Pagination options
|
|
696
|
+
* @returns Corporate bodies feed data
|
|
697
|
+
*/
|
|
698
|
+
async getCorporateBodiesFeed(options = {}) {
|
|
699
|
+
return this.safeCallTool('get_corporate_bodies_feed', options, EuropeanParliamentMCPClient.FEED_FALLBACK);
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
* Get controlled vocabularies feed (most recent updates via EP API v2)
|
|
703
|
+
*
|
|
704
|
+
* @param options - Pagination options
|
|
705
|
+
* @returns Controlled vocabularies feed data
|
|
706
|
+
*/
|
|
707
|
+
async getControlledVocabulariesFeed(options = {}) {
|
|
708
|
+
return this.safeCallTool('get_controlled_vocabularies_feed', options, EuropeanParliamentMCPClient.FEED_FALLBACK);
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
let clientInstance = null;
|
|
712
|
+
/**
|
|
713
|
+
* Get or create singleton MCP client instance
|
|
714
|
+
*
|
|
715
|
+
* @param options - Client options
|
|
716
|
+
* @returns Connected MCP client
|
|
717
|
+
*/
|
|
718
|
+
export async function getEPMCPClient(options = {}) {
|
|
719
|
+
if (!clientInstance) {
|
|
720
|
+
clientInstance = new EuropeanParliamentMCPClient(options);
|
|
721
|
+
await clientInstance.connect();
|
|
722
|
+
}
|
|
723
|
+
return clientInstance;
|
|
724
|
+
}
|
|
725
|
+
/**
|
|
726
|
+
* Close and cleanup singleton MCP client
|
|
727
|
+
*/
|
|
728
|
+
export async function closeEPMCPClient() {
|
|
729
|
+
if (clientInstance) {
|
|
730
|
+
clientInstance.disconnect();
|
|
731
|
+
clientInstance = null;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
//# sourceMappingURL=ep-mcp-client.js.map
|