Skip to main content
Glama
psalzman

MCP OpenFEC Server

by psalzman

get_bulk_downloads

Download bulk Federal Election Commission data files for campaign finance analysis, including contributions, expenditures, filings, committees, and candidates.

Instructions

Get links to bulk data downloads

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
data_typeYesType of bulk data to download
election_yearNoOptional: Election year for the data

Implementation Reference

  • The handler function that executes the get_bulk_downloads tool. It validates input using Zod, checks rate limit, queries the OpenFEC API /download endpoint, and returns the JSON response as text content.
    private async handleGetBulkDownloads(args: any) {
      const schema = z.object({
        data_type: z.enum(['contributions', 'expenditures', 'filings', 'committees', 'candidates']),
        election_year: z.number().optional()
      });
    
      const { data_type, election_year } = schema.parse(args);
      this.rateLimiter.consumeToken();
    
      const response = await this.axiosInstance.get('/download', {
        params: {
          data_type,
          election_year
        }
      });
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(response.data, null, 2),
          },
        ],
      };
    }
  • src/server.ts:415-433 (registration)
    Registration of the get_bulk_downloads tool in the ListToolsRequestSchema handler response, defining the tool name, description, and input schema.
    {
      name: 'get_bulk_downloads',
      description: 'Get links to bulk data downloads',
      inputSchema: {
        type: 'object',
        properties: {
          data_type: {
            type: 'string',
            enum: ['contributions', 'expenditures', 'filings', 'committees', 'candidates'],
            description: 'Type of bulk data to download'
          },
          election_year: {
            type: 'number',
            description: 'Optional: Election year for the data'
          }
        },
        required: ['data_type']
      }
    }
  • Zod schema for input validation within the handler, matching the registered inputSchema.
    const schema = z.object({
      data_type: z.enum(['contributions', 'expenditures', 'filings', 'committees', 'candidates']),
      election_year: z.number().optional()
    });
  • src/server.ts:469-470 (registration)
    Dispatch case in the CallToolRequestSchema handler that routes get_bulk_downloads calls to the specific handler method.
    case 'get_bulk_downloads':
      return await this.handleGetBulkDownloads(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 mentions 'Get links' but doesn't specify whether this is a read-only operation, if it requires authentication, what format the links are in (e.g., URLs, file paths), or any rate limits. For a tool with no annotation coverage, this leaves critical behavioral traits unaddressed.

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 a single, efficient sentence with zero wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place, achieving optimal conciseness without sacrificing clarity.

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

Completeness3/5

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

Given the tool's moderate complexity (2 parameters, no annotations, no output schema), the description is minimally adequate. It states the purpose but lacks behavioral details, usage context, and output information. With no output schema, the description doesn't explain what 'links' entail (e.g., format, structure), leaving gaps that could hinder effective use.

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 schema description coverage is 100%, with clear descriptions for both parameters, including an enum for 'data_type'. The description adds no additional parameter semantics beyond what the schema provides, such as explaining the relationship between 'data_type' and 'election_year' or usage examples. Baseline 3 is appropriate given the schema does the heavy lifting.

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 action ('Get links') and resource ('bulk data downloads'), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling tools like 'get_filings' or 'get_candidate_contributions' that might also provide data downloads, missing an opportunity for precise distinction.

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_filings' or 'search_candidates' that might offer similar or overlapping data, there's no indication of scope, prerequisites, or comparative use cases, leaving the agent to guess based on tool names alone.

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