Skip to main content
Glama
sh-patterson

fec-mcp-server

get_committee_finances

Retrieve comprehensive financial summary for a campaign committee from FEC filings, including receipts, disbursements, cash on hand, debts, loans, and burn rate for transparency research.

Instructions

Retrieve comprehensive financial summary for a campaign committee from official FEC filings. Returns total receipts, disbursements, cash on hand, debts, loans (including candidate loans), and calculates burn rate (spending/income ratio). Includes Schedule C loans and Schedule D debts for complete financial picture. Essential for understanding campaign financial health and transparency research.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
committee_idYesFEC committee ID (e.g., "C00401224")
cycleNoTwo-year election cycle (e.g., 2024). Defaults to most recent.

Implementation Reference

  • The main handler function `executeGetCommitteeFinances` that fetches committee reports, loans (Schedule C), and debts (Schedule D) in parallel, transforms them, calculates totals/candidate loans, and returns a formatted financial summary.
    export async function executeGetCommitteeFinances(
      client: FECClient,
      params: {
        committee_id: string;
        cycle?: number;
      }
    ): Promise<GetCommitteeFinancesResult> {
      try {
        // Fetch reports, loans, and debts in parallel
        const [reportsResponse, loansResponse, debtsResponse] = await Promise.all([
          client.getCommitteeReports(params.committee_id, {
            cycle: params.cycle,
          }),
          client.getScheduleC({
            committee_id: params.committee_id,
            two_year_transaction_period: params.cycle,
            limit: 20,
          }),
          client.getScheduleD({
            committee_id: params.committee_id,
            two_year_transaction_period: params.cycle,
            limit: 20,
          }),
        ]);
    
        if (reportsResponse.results.length === 0) {
          throw new NotFoundError('Committee reports', params.committee_id);
        }
    
        // Get the most recent report
        const report = reportsResponse.results[0];
        const baseSummary = transformCommitteeReport(report);
    
        // Transform loans and debts
        const loans = transformLoans(loansResponse.results);
        const debts = transformDebts(debtsResponse.results);
    
        // Calculate loan totals
        const totalLoans = loans.reduce((sum, loan) => sum + loan.amount, 0);
        const candidateLoans = loans
          .filter(loan => loan.is_candidate_loan)
          .reduce((sum, loan) => sum + loan.amount, 0);
    
        // Build enhanced summary
        const enhancedSummary: EnhancedFinancialSummary = {
          ...baseSummary,
          total_loans: totalLoans,
          candidate_loans: candidateLoans,
          loans,
          debts,
        };
    
        const formattedText = formatEnhancedFinancialSummaryText(enhancedSummary);
    
        return {
          content: [{ type: 'text', text: formattedText }],
        };
      } catch (error) {
        return {
          content: [{ type: 'text', text: formatErrorForToolResponse(error) }],
          isError: true,
        };
      }
    }
  • Zod schema definitions for get_committee_finances input validation: committee_id (C followed by 8 digits) and optional cycle (1980-2030).
    /**
     * Zod Schema for get_committee_finances tool
     */
    
    import { z } from 'zod';
    
    // Committee ID format: C followed by 8 digits
    const committeeIdPattern = /^C\d{8}$/;
    
    export const getCommitteeFinancesInputSchema = {
      committee_id: z
        .string()
        .regex(committeeIdPattern, 'Committee ID must be in format C00000000 (C followed by 8 digits)')
        .describe('FEC committee ID (e.g., "C00401224")'),
    
      cycle: z
        .number()
        .int()
        .min(1980, 'Cycle must be 1980 or later')
        .max(2030, 'Cycle must be 2030 or earlier')
        .optional()
        .describe('Two-year election cycle (e.g., 2024). Defaults to most recent.'),
    };
    
    export const getCommitteeFinancesParamsSchema = z.object(
      getCommitteeFinancesInputSchema
    );
    
    export type GetCommitteeFinancesInput = z.infer<
      typeof getCommitteeFinancesParamsSchema
    >;
  • Registration of the 'get_committee_finances' tool with the MCP server, mapping the tool definition, params schema, and execute function.
    {
      def: GET_COMMITTEE_FINANCES_TOOL,
      paramsSchema: getCommitteeFinancesParamsSchema,
      execute: async (params) =>
        executeGetCommitteeFinances(client, params as {
          committee_id: string;
          cycle?: number;
        }),
    },
  • Tool definition constant GET_COMMITTEE_FINANCES_TOOL with name 'get_committee_finances', description, and input schema reference.
    export const GET_COMMITTEE_FINANCES_TOOL = {
      name: 'get_committee_finances',
      description: `Retrieve comprehensive financial summary for a campaign committee from official FEC filings. Returns total receipts, disbursements, cash on hand, debts, loans (including candidate loans), and calculates burn rate (spending/income ratio). Includes Schedule C loans and Schedule D debts for complete financial picture. Essential for understanding campaign financial health and transparency research.`,
      inputSchema: getCommitteeFinancesInputSchema,
    };
  • Acceptance test script calling executeGetCommitteeFinances with committee_id and cycle to verify the tool works end-to-end.
    const financeStart = performance.now();
    const finances = await executeGetCommitteeFinances(client, {
      committee_id: committeeId,
      cycle: target.cycle,
    });
    console.log(`[get_committee_finances] ${finances.isError ? 'ERROR' : 'ok'} (${elapsedMs(financeStart)}ms)`);
Behavior4/5

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

No annotations provided, so description carries full burden. It details the returned metrics (receipts, disbursements, cash, debts, loans, burn rate) and mentions Schedule C/D inclusion. Does not disclose potential limitations like data freshness or rate limits, but is thorough for a read tool.

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?

Three sentences with no waste. The main action is first, followed by contents, then use case. Efficient and well-structured.

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

Completeness4/5

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

No output schema, so description explains return values clearly. Covers the main aspects of the financial summary, but missing details on error handling or pagination, which may be acceptable for this tool.

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 covers 100% of parameters with descriptions. The description adds no extra meaning beyond the schema; it restates the default for cycle which is already in the schema.

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

Purpose5/5

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

Clearly states it retrieves a comprehensive financial summary for a campaign committee from official FEC filings. Specific verb, resource, and scope distinguish it from more specific sibling tools like get_disbursements and get_receipts.

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

Usage Guidelines4/5

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

States it is essential for understanding campaign financial health and transparency research, implying the appropriate use case. However, it does not explicitly exclude when to use sibling tools for detailed breakdowns.

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/sh-patterson/fec-mcp-server'

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