get_most_active_lobbyists
Identify organizations with the highest number of EU lobbying meetings to analyze influence patterns and regulatory engagement.
Instructions
Get organizations with the most EU lobbying meetings
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of results |
Implementation Reference
- src/database.ts:294-328 (handler)Core handler function that fetches lobbying data from API, aggregates meetings by organization, computes statistics, and returns top N most active lobbyists.async getMostActiveLobbyists(limit: number = 10): Promise<any[]> { const data = await this.fetchAPI('/api/lobbying'); const meetings = data.meetings || data.lobbying || []; // Group by organization and count meetings const orgCounts = new Map(); meetings.forEach(meeting => { const org = meeting.organization_name; if (!org) return; if (!orgCounts.has(org)) { orgCounts.set(org, { organization_name: org, meeting_count: 0, institutions: new Set(), spending: [] }); } const entry = orgCounts.get(org); entry.meeting_count++; if (meeting.eu_institution) entry.institutions.add(meeting.eu_institution); if (meeting.quarterly_spending) entry.spending.push(meeting.quarterly_spending); }); return Array.from(orgCounts.values()) .map(entry => ({ ...entry, institutions: Array.from(entry.institutions).join(','), avg_spending: entry.spending.length > 0 ? entry.spending.reduce((sum, val) => sum + val, 0) / entry.spending.length : null })) .sort((a, b) => b.meeting_count - a.meeting_count) .slice(0, limit); }
- src/index.ts:637-639 (handler)MCP CallToolRequest handler case that invokes the database method with optional limit parameter.case 'get_most_active_lobbyists': result = await this.db.getMostActiveLobbyists((args as any)?.limit || 10); break;
- src/index.ts:286-298 (registration)Tool registration in ListToolsRequest handler, including schema for optional limit parameter.name: 'get_most_active_lobbyists', description: 'Get organizations with the most EU lobbying meetings', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Maximum number of results', default: 10, }, }, }, },