Skip to main content
Glama

get_most_active_lobbyists

Identify organizations with the most EU lobbying meetings to analyze influence in regulatory processes.

Instructions

Get organizations with the most EU lobbying meetings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of results

Implementation Reference

  • Core handler function that fetches lobbying meetings data from the API, groups meetings by organization, counts occurrences, aggregates institutions and spending, then returns the top N most active lobbyists sorted by meeting count.
    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:285-298 (registration)
    Tool registration in the listTools handler, defining the tool name, description, and input schema (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, }, }, }, },
  • MCP CallToolRequest handler switch case that extracts the limit argument and delegates to the DatabaseManager's getMostActiveLobbyists method.
    case 'get_most_active_lobbyists': result = await this.db.getMostActiveLobbyists((args as any)?.limit || 10); break;
  • JSON schema defining the tool's input parameters (optional limit with default 10).
    inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Maximum number of results', default: 10, }, }, },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/anbrme/ibex35-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server