Skip to main content
Glama
psalzman

MCP OpenFEC Server

by psalzman

get_electioneering

Retrieve electioneering communications data from the Federal Election Commission to analyze political advertising expenditures by date, amount, candidate, or committee.

Instructions

Get electioneering communications

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
committee_idNoOptional: FEC committee ID
candidate_idNoOptional: FEC candidate ID
min_dateNoOptional: Minimum disbursement date (YYYY-MM-DD)
max_dateNoOptional: Maximum disbursement date (YYYY-MM-DD)
min_amountNoOptional: Minimum disbursement amount
max_amountNoOptional: Maximum disbursement amount
sortNoOptional: Sort by disbursement amount

Implementation Reference

  • Executes the 'get_electioneering' tool: validates input with Zod schema matching the registered inputSchema, applies rate limiting, queries the OpenFEC '/electioneering' API endpoint with provided filters, and returns the paginated JSON results as MCP tool content.
    private async handleGetElectioneering(args: any) {
      const schema = z.object({
        committee_id: z.string().optional(),
        candidate_id: z.string().optional(),
        min_date: z.string().optional(),
        max_date: z.string().optional(),
        min_amount: z.number().optional(),
        max_amount: z.number().optional(),
        sort: z.enum(['asc', 'desc']).optional()
      });
    
      const params = schema.parse(args);
      this.rateLimiter.consumeToken();
    
      const response = await this.axiosInstance.get('/electioneering', {
        params: {
          ...params,
          sort_hide_null: true,
          sort: params.sort === 'desc' ? '-disbursement_amount' : 'disbursement_amount',
          per_page: 20
        }
      });
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(response.data, null, 2),
          },
        ],
      };
    }
  • Defines the input schema for the 'get_electioneering' tool, specifying optional parameters for filtering electioneering communications data from the OpenFEC API.
    inputSchema: {
      type: 'object',
      properties: {
        committee_id: {
          type: 'string',
          description: 'Optional: FEC committee ID'
        },
        candidate_id: {
          type: 'string',
          description: 'Optional: FEC candidate ID'
        },
        min_date: {
          type: 'string',
          description: 'Optional: Minimum disbursement date (YYYY-MM-DD)'
        },
        max_date: {
          type: 'string',
          description: 'Optional: Maximum disbursement date (YYYY-MM-DD)'
        },
        min_amount: {
          type: 'number',
          description: 'Optional: Minimum disbursement amount'
        },
        max_amount: {
          type: 'number',
          description: 'Optional: Maximum disbursement amount'
        },
        sort: {
          type: 'string',
          enum: ['asc', 'desc'],
          description: 'Optional: Sort by disbursement amount'
        }
      }
    }
  • src/server.ts:275-312 (registration)
    Registers the 'get_electioneering' tool in the MCP server's ListTools response, providing name, description, and input schema.
    {
      name: 'get_electioneering',
      description: 'Get electioneering communications',
      inputSchema: {
        type: 'object',
        properties: {
          committee_id: {
            type: 'string',
            description: 'Optional: FEC committee ID'
          },
          candidate_id: {
            type: 'string',
            description: 'Optional: FEC candidate ID'
          },
          min_date: {
            type: 'string',
            description: 'Optional: Minimum disbursement date (YYYY-MM-DD)'
          },
          max_date: {
            type: 'string',
            description: 'Optional: Maximum disbursement date (YYYY-MM-DD)'
          },
          min_amount: {
            type: 'number',
            description: 'Optional: Minimum disbursement amount'
          },
          max_amount: {
            type: 'number',
            description: 'Optional: Maximum disbursement amount'
          },
          sort: {
            type: 'string',
            enum: ['asc', 'desc'],
            description: 'Optional: Sort by disbursement amount'
          }
        }
      }
    },
  • src/server.ts:461-462 (registration)
    Registers the handler dispatch for 'get_electioneering' in the CallToolRequestHandler switch statement.
    case 'get_electioneering':
      return await this.handleGetElectioneering(request.params.arguments);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states what the tool does ('Get electioneering communications') without mentioning any behavioral traits such as whether this is a read-only operation, potential rate limits, authentication requirements, pagination behavior, or what the output looks like. This leaves significant gaps for an agent to understand how to interact with it effectively.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with just three words, front-loading the core purpose without any wasted text. Every word earns its place, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a tool with 7 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain the return values, behavioral aspects, or usage context, leaving the agent with incomplete information to operate the tool effectively despite the good parameter documentation in the schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with all 7 parameters well-documented (e.g., committee_id, candidate_id, date ranges, amounts, sort). The description adds no additional parameter information beyond what's in the schema, so it meets the baseline score of 3 for high schema coverage without compensating value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('electioneering communications'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its siblings (like get_communication_costs or get_independent_expenditures) which might also retrieve related political communication data, so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like get_communication_costs and get_independent_expenditures that might overlap in domain, there's no indication of what makes electioneering communications distinct or when this specific tool is appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/psalzman/mcp-openfec'

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