Skip to main content
Glama
psalzman

MCP OpenFEC Server

by psalzman

get_party_coordinated_expenditures

Retrieve party coordinated expenditures from Federal Election Commission data to analyze campaign finance activities by filtering committee, candidate, date range, and amount parameters.

Instructions

Get party coordinated expenditures

Input Schema

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

Implementation Reference

  • The main handler function for the 'get_party_coordinated_expenditures' tool. Validates input with Zod schema matching the registered inputSchema, consumes rate limit token, fetches data from OpenFEC API endpoint '/schedules/schedule_f' with provided filters and sorting, paginates to 20 results, and returns the JSON response as text content.
    private async handleGetPartyCoordinatedExpenditures(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('/schedules/schedule_f', {
        params: {
          ...params,
          sort_hide_null: true,
          sort: params.sort === 'desc' ? '-expenditure_amount' : 'expenditure_amount',
          per_page: 20
        }
      });
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(response.data, null, 2),
          },
        ],
      };
    }
  • src/server.ts:313-350 (registration)
    Registration of the tool in the ListTools handler response array, including name, description, and detailed inputSchema for parameters like committee_id, candidate_id, date ranges, amount filters, and sort order.
    {
      name: 'get_party_coordinated_expenditures',
      description: 'Get party coordinated expenditures',
      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 expenditure date (YYYY-MM-DD)'
          },
          max_date: {
            type: 'string',
            description: 'Optional: Maximum expenditure date (YYYY-MM-DD)'
          },
          min_amount: {
            type: 'number',
            description: 'Optional: Minimum expenditure amount'
          },
          max_amount: {
            type: 'number',
            description: 'Optional: Maximum expenditure amount'
          },
          sort: {
            type: 'string',
            enum: ['asc', 'desc'],
            description: 'Optional: Sort by expenditure amount'
          }
        }
      }
    },
  • src/server.ts:463-464 (registration)
    Dispatch/registration in the CallToolRequestSchema switch statement that routes calls to the specific handler method.
    case 'get_party_coordinated_expenditures':
      return await this.handleGetPartyCoordinatedExpenditures(request.params.arguments);
  • Zod schema for input validation inside the handler, mirroring the registered inputSchema.
    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()
    });
Behavior1/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It states 'Get' which implies a read operation, but offers no details on permissions, rate limits, pagination, error handling, or what the return data looks like. For a tool with 7 parameters and no output schema, this leaves critical behavioral aspects undocumented.

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

Conciseness2/5

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

While technically concise with just three words, this is under-specification rather than effective brevity. The description fails to provide necessary context and doesn't earn its place as a helpful tool description. It's too minimal to be considered well-structured for agent understanding.

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 7 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what 'party coordinated expenditures' are, how results are returned, or any behavioral aspects. The agent would struggle to use this tool effectively without significant additional context or trial-and-error.

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?

Schema description coverage is 100%, so all parameters are documented in the input schema with clear descriptions. The description adds no additional parameter information beyond what's in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

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

Purpose2/5

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

The description 'Get party coordinated expenditures' is essentially a tautology that restates the tool name. It provides the basic verb ('Get') and resource ('party coordinated expenditures') but lacks specificity about what exactly is being retrieved or any distinguishing features from sibling tools like get_independent_expenditures or get_communication_costs. No additional context about scope or format is provided.

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

Usage Guidelines1/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. There is no mention of context, prerequisites, or comparisons to sibling tools like get_independent_expenditures or get_communication_costs, which appear related to expenditure tracking. The agent receives no help in selecting between these options.

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