Skip to main content
Glama
psalzman

MCP OpenFEC Server

by psalzman

get_filings

Retrieve Federal Election Commission filings by filtering for committee, candidate, form type, date range, state, or sorting options to access campaign finance data.

Instructions

Retrieve official FEC filings with filters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
committee_idNoOptional: FEC committee ID
candidate_idNoOptional: FEC candidate ID
form_typeNoOptional: Form types to filter by (e.g., ["F3", "F3P"])
min_receipt_dateNoOptional: Minimum receipt date (YYYY-MM-DD)
max_receipt_dateNoOptional: Maximum receipt date (YYYY-MM-DD)
stateNoOptional: Two-letter state code
sortNoOptional: Sort by receipt date

Implementation Reference

  • The handler function that implements the get_filings tool logic: validates input with Zod schema, applies rate limiting, queries the OpenFEC API /filings endpoint with filters, and returns the response as MCP content.
    private async handleGetFilings(args: any) {
      const schema = z.object({
        committee_id: z.string().optional(),
        candidate_id: z.string().optional(),
        form_type: z.array(z.string()).optional(),
        min_receipt_date: z.string().optional(),
        max_receipt_date: z.string().optional(),
        state: z.string().optional(),
        sort: z.enum(['asc', 'desc']).optional()
      });
    
      const params = schema.parse(args);
      this.rateLimiter.consumeToken();
    
      const response = await this.axiosInstance.get('/filings', {
        params: {
          ...params,
          sort_hide_null: true,
          sort: params.sort === 'desc' ? '-receipt_date' : 'receipt_date',
          per_page: 20
        }
      });
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(response.data, null, 2),
          },
        ],
      };
    }
  • Input schema definition for the get_filings tool, advertised in the ListTools response.
    inputSchema: {
      type: 'object',
      properties: {
        committee_id: {
          type: 'string',
          description: 'Optional: FEC committee ID'
        },
        candidate_id: {
          type: 'string',
          description: 'Optional: FEC candidate ID'
        },
        form_type: {
          type: 'array',
          items: { type: 'string' },
          description: 'Optional: Form types to filter by (e.g., ["F3", "F3P"])'
        },
        min_receipt_date: {
          type: 'string',
          description: 'Optional: Minimum receipt date (YYYY-MM-DD)'
        },
        max_receipt_date: {
          type: 'string',
          description: 'Optional: Maximum receipt date (YYYY-MM-DD)'
        },
        state: {
          type: 'string',
          description: 'Optional: Two-letter state code'
        },
        sort: {
          type: 'string',
          enum: ['asc', 'desc'],
          description: 'Optional: Sort by receipt date'
        }
      }
    }
  • src/server.ts:193-231 (registration)
    Tool registration in the ListToolsRequestSchema handler, defining name, description, and inputSchema for get_filings.
    {
      name: 'get_filings',
      description: 'Retrieve official FEC filings with filters',
      inputSchema: {
        type: 'object',
        properties: {
          committee_id: {
            type: 'string',
            description: 'Optional: FEC committee ID'
          },
          candidate_id: {
            type: 'string',
            description: 'Optional: FEC candidate ID'
          },
          form_type: {
            type: 'array',
            items: { type: 'string' },
            description: 'Optional: Form types to filter by (e.g., ["F3", "F3P"])'
          },
          min_receipt_date: {
            type: 'string',
            description: 'Optional: Minimum receipt date (YYYY-MM-DD)'
          },
          max_receipt_date: {
            type: 'string',
            description: 'Optional: Maximum receipt date (YYYY-MM-DD)'
          },
          state: {
            type: 'string',
            description: 'Optional: Two-letter state code'
          },
          sort: {
            type: 'string',
            enum: ['asc', 'desc'],
            description: 'Optional: Sort by receipt date'
          }
        }
      }
    },
  • src/server.ts:457-458 (registration)
    Dispatch case in the CallToolRequestSchema handler that routes get_filings calls to the handleGetFilings method.
    case 'get_filings':
      return await this.handleGetFilings(request.params.arguments);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions retrieval with filters but doesn't cover critical aspects like whether this is a read-only operation, potential rate limits, authentication needs, pagination behavior, or error handling. This is inadequate for a tool with 7 parameters and no output schema.

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 that directly states the tool's function without unnecessary words. It's front-loaded and wastes no space, 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 (7 parameters, no annotations, no output schema), the description is insufficient. It doesn't explain what 'official FEC filings' entail, how results are returned, or any behavioral traits, leaving significant gaps for an AI agent to operate effectively.

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%, so the schema already documents all parameters thoroughly. The description adds minimal value by mentioning 'filters', which aligns with the optional parameters in the schema, but doesn't provide additional context or examples beyond what's in the schema descriptions.

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 ('Retrieve') and resource ('official FEC filings'), making the purpose understandable. However, it doesn't specifically differentiate this tool from its siblings like 'get_candidate_financials' or 'get_committee', which might also retrieve FEC-related 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 like 'get_candidate' or 'search_candidates'. It mentions filters but doesn't specify scenarios or exclusions, leaving the agent to infer usage from the tool name and parameters 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