Skip to main content
Glama

Openfec Search Candidates

openfec_search_candidates
Read-onlyIdempotent

Find federal candidates by name, state, office, party, or cycle. Retrieve a specific candidate by FEC ID with financial totals. Candidate IDs start with H (House), S (Senate), or P (President) followed by exactly eight letters or digits.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "openfec_search_candidates"
  }
}

Input Schema

NameRequiredDescriptionDefault
pageNoSearch-results page number (1-indexed). Defaults to 1 on the search path.
cycleNoTwo-year election cycle (even year, e.g., 2024).
partyNoParty code as OpenFEC files it, up to three characters (e.g., DEM, REP, LIB, W).
queryNoFull-text candidate name search.
stateNoTwo-letter US state code (e.g., AZ, CA).
officeNoFilter by office: H=House, S=Senate, P=President.
districtNoTwo-digit district number for House candidates.
per_pageNoSearch results per page. Defaults to 20 on the search path.
candidate_idNoFEC candidate ID: H, S, or P followed by exactly eight letters or digits (e.g., P00003392, H2CO07170). Get IDs from openfec_search_candidates results. When provided, returns a single candidate with full detail.
election_yearNoSpecific election year the candidate ran in.
include_totalsNoInclude financial totals (receipts, disbursements, cash on hand). Defaults to true when fetching by candidate_id.
candidate_statusNoCandidate status: C=present, F=future, N=not yet, P=prior.
has_raised_fundsNoOnly candidates whose committee has received receipts.
incumbent_challengeNoIncumbent status: I=incumbent, C=challenger, O=open seat.

Output Schema

NameRequiredDescriptionDefault
errorNoPresent when the call failed. Absent on success.
noticeNoGuidance when the response needs context: how to broaden a search that matched nothing, which requested position ran out when candidates did match, or that the financial totals are incomplete and how to read the rest.
totalsNoFinancial totals (receipts, disbursements, cash_on_hand) when include_totals is true. One row per candidate per cycle.
candidatesNoCandidate result set; one record per match.
paginationNoPage-based pagination metadata.
totalCountNoTotal matching candidates before pagination.
search_criteriaNoEcho of the search filters this call applied, as the server parsed them, minus paging arguments. Always present — compare it against what you sent to confirm every filter was honoured.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • changedInput schema / properties / party / description
      Previous value: -"Three-letter party code (e.g., DEM, REP, LIB)."New value: +"Party code as OpenFEC files it, up to three characters (e.g., DEM, REP, LIB, W)."
    • changedInput schema / properties / per_page / description
      Previous value: -"Search results per page. Defaults to 20 on the search path. With include_totals, at most 35 candidates are requested when cycle or election_year scopes the totals and 5 when the totals span every cycle, keeping the response under a 100,000-byte budget. A page bounded below your request reports truncated and cap, and pagination.per_page echoes the size applied — page numbers count at that size, so continue with the next page number."New value: +"Search results per page. Defaults to 20 on the search path."
    • removedOutput schema / properties / cap
      Removed value: -{
      -  "description": "The per_page this call applied in place of the one requested — the page-size ceiling for this tool and scope. Present only when truncated is true.",
      -  "type": "number"
      -}
    • removedOutput schema / properties / missing_totals
      Removed value: -{
      -  "description": "Candidates whose financial totals were not retrieved because the totals fetch hit its page cap. Re-query each one on its own with candidate_id to get its totals.",
      -  "items": {
      -    "description": "FEC candidate ID with no totals row in this response.",
      -    "type": "string"
      -  },
      -  "type": "array"
      -}
    • changedOutput schema / properties / notice / description
      Previous value: -"Guidance when the response needs context: how to broaden a search that matched nothing, which requested position ran out when candidates did match, or that the page was bounded below the per_page requested and how to continue."New value: +"Guidance when the response needs context: how to broaden a search that matched nothing, which requested position ran out when candidates did match, or that the financial totals are incomplete and how to read the rest."
    • removedOutput schema / properties / shown
      Removed value: -{
      -  "description": "Rows in this page. Present only when truncated is true.",
      -  "type": "number"
      -}
    • removedOutput schema / properties / truncated
      Removed value: -{
      -  "description": "True when this page holds fewer rows than the per_page requested because a full page would exceed the 100,000-byte response budget, and more rows remain. Absent on a complete page, including a naturally short last page.",
      -  "type": "boolean"
      -}
  2. Changed5 schema fields changed
    • changedInput schema / properties / per_page / description
      Previous value: -"Search results per page. Defaults to 20 on the search path."New value: +"Search results per page. Defaults to 20 on the search path. With include_totals, at most 35 candidates are requested when cycle or election_year scopes the totals and 5 when the totals span every cycle, keeping the response under a 100,000-byte budget. A page bounded below your request reports truncated and cap, and pagination.per_page echoes the size applied — page numbers count at that size, so continue with the next page number."
    • addedOutput schema / properties / cap
      Added value: +{
      +  "description": "The per_page this call applied in place of the one requested — the page-size ceiling for this tool and scope. Present only when truncated is true.",
      +  "type": "number"
      +}
    • changedOutput schema / properties / notice / description
      Previous value: -"Guidance when the response carries no candidates: how to broaden a search that matched nothing, or which requested position ran out when candidates did match."New value: +"Guidance when the response needs context: how to broaden a search that matched nothing, which requested position ran out when candidates did match, or that the page was bounded below the per_page requested and how to continue."
    • addedOutput schema / properties / shown
      Added value: +{
      +  "description": "Rows in this page. Present only when truncated is true.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / truncated
      Added value: +{
      +  "description": "True when this page holds fewer rows than the per_page requested because a full page would exceed the 100,000-byte response budget, and more rows remain. Absent on a complete page, including a naturally short last page.",
      +  "type": "boolean"
      +}
  3. Changed2 schema fields changed
    • changedOutput schema / properties / notice / description
      Previous value: -"Guidance when no candidates matched — echoes filters and suggests how to broaden."New value: +"Guidance when the response carries no candidates: how to broaden a search that matched nothing, or which requested position ran out when candidates did match."
    • addedOutput schema / properties / pagination / properties / count_is_approximate
      Added value: +{
      +  "description": "True when OpenFEC reports this count as an estimate rather than a tally, which it does on its highest-volume datasets. Absent means the count is a tally. An estimated count — and the pages derived from it — can be off by a wide margin; treat it as an order of magnitude, not a figure to quote.",
      +  "type": "boolean"
      +}
  4. Changed1 schema field changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `candidate_not_found`: Single-candidate lookup by candidate_id returned no record `inputs_not_applicable_to_id_lookup`: A direct candidate_id lookup includes search-only inputs, or totals-only scope while include_totals is false Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `candidate_not_found`: Single-candidate lookup by candidate_id returned no record. `inputs_not_applicable_to_id_lookup`: A direct candidate_id lookup includes search-only inputs, or totals-only scope while include_totals is false. Other values are possible when a failure originates below the handler."
  5. Changed7 schema fields changed
    • changedInput schema / properties / candidate_id / description
      Previous value: -"FEC candidate ID (e.g., P00003392, H2CO07170). Get IDs from openfec_search_candidates results. When provided, returns a single candidate with full detail."New value: +"FEC candidate ID: H, S, or P followed by exactly eight letters or digits (e.g., P00003392, H2CO07170). Get IDs from openfec_search_candidates results. When provided, returns a single candidate with full detail."
    • removedInput schema / properties / page / default
      Removed value: -1
    • changedInput schema / properties / page / description
      Previous value: -"Page number (1-indexed)."New value: +"Search-results page number (1-indexed). Defaults to 1 on the search path."
    • removedInput schema / properties / per_page / default
      Removed value: -20
    • changedInput schema / properties / per_page / description
      Previous value: -"Results per page."New value: +"Search results per page. Defaults to 20 on the search path."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `candidate_not_found`: Single-candidate lookup by candidate_id returned no record Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `candidate_not_found`: Single-candidate lookup by candidate_id returned no record `inputs_not_applicable_to_id_lookup`: A direct candidate_id lookup includes search-only inputs, or totals-only scope while include_totals is false Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "candidate_not_found"
      -]New value: +[
      +  "candidate_not_found",
      +  "inputs_not_applicable_to_id_lookup"
      +]
  6. Changed6 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / additionalProperties
      Added value: +false
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedOutput schema / anyOf
      Added value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "error"
      +      ]
      +    },
      +    "required": [
      +      "candidates",
      +      "pagination",
      +      "search_criteria",
      +      "totalCount"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "error"
      +    ]
      +  }
      +]
    • addedOutput schema / properties / error
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "Present when the call failed. Absent on success.",
      +  "properties": {
      +    "code": {
      +      "description": "JSON-RPC error code for this failure.",
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "data": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "reason": {
      +          "description": "Machine-readable failure mode. Declared by this tool: `candidate_not_found`: Single-candidate lookup by candidate_id returned no record Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "candidate_not_found"
      +          ],
      +          "type": "string"
      +        },
      +        "recovery": {
      +          "additionalProperties": {},
      +          "description": "Actionable next step for the caller.",
      +          "properties": {
      +            "hint": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "hint"
      +          ],
      +          "type": "object"
      +        },
      +        "retryable": {
      +          "description": "Whether retrying may succeed.",
      +          "type": "boolean"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "message": {
      +      "description": "Human-readable description of what went wrong.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "code",
      +    "message"
      +  ],
      +  "type": "object"
      +}
    • removedOutput schema / required
      Removed value: -[
      -  "candidates",
      -  "pagination",
      -  "search_criteria",
      -  "totalCount"
      -]
  7. Changed2 schema fields changed
    • changedOutput schema / properties / search_criteria / description
      Previous value: -"Echo of the search filters that produced this result set. Populated when results are empty to help diagnose why nothing matched."New value: +"Echo of the search filters this call applied, as the server parsed them, minus paging arguments. Always present — compare it against what you sent to confirm every filter was honoured."
    • changedOutput schema / required
      Previous value: -[
      -  "candidates",
      -  "pagination",
      -  "totalCount"
      -]New value: +[
      +  "candidates",
      +  "pagination",
      +  "search_criteria",
      +  "totalCount"
      +]
  8. Changed2 schema fields changed
    • addedOutput schema / properties / missing_totals
      Added value: +{
      +  "description": "Candidates whose financial totals were not retrieved because the totals fetch hit its page cap. Re-query each one on its own with candidate_id to get its totals.",
      +  "items": {
      +    "description": "FEC candidate ID with no totals row in this response.",
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / properties / totals / description
      Previous value: -"Financial totals (receipts, disbursements, cash_on_hand) when include_totals is true."New value: +"Financial totals (receipts, disbursements, cash_on_hand) when include_totals is true. One row per candidate per cycle."
  9. Changed1 schema field changed
    • removedInput schema / properties / candidate_id / pattern
      Removed value: -"^[HSP][0-9A-Z]+$"
  10. Changed3 schema fields changed
    • addedOutput schema / properties / notice
      Added value: +{
      +  "description": "Guidance when no candidates matched — echoes filters and suggests how to broaden.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / totalCount
      Added value: +{
      +  "description": "Total matching candidates before pagination.",
      +  "type": "number"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "candidates",
      -  "pagination"
      -]New value: +[
      +  "candidates",
      +  "pagination",
      +  "totalCount"
      +]
  11. Changed2 schema fields changed
    • changedInput schema / properties / candidate_id / description
      Previous value: -"FEC candidate ID (e.g., P00003392, H2CO07170). When provided, returns a single candidate with full detail."New value: +"FEC candidate ID (e.g., P00003392, H2CO07170). Get IDs from openfec_search_candidates results. When provided, returns a single candidate with full detail."
    • addedInput schema / properties / candidate_id / pattern
      Added value: +"^[HSP][0-9A-Z]+$"
  12. Changed13 schema fields changed
    • addedInput schema / properties / page / default
      Added value: +1
    • changedInput schema / properties / page / description
      Previous value: -"Page number (1-indexed). Default 1."New value: +"Page number (1-indexed)."
    • addedInput schema / properties / page / maximum
      Added value: +9007199254740991
    • addedInput schema / properties / page / minimum
      Added value: +1
    • changedInput schema / properties / page / type
      Previous value: -"number"New value: +"integer"
    • addedInput schema / properties / per_page / default
      Added value: +20
    • changedInput schema / properties / per_page / description
      Previous value: -"Results per page. Default 20, max 100."New value: +"Results per page."
    • addedInput schema / properties / per_page / maximum
      Added value: +100
    • addedInput schema / properties / per_page / minimum
      Added value: +1
    • changedInput schema / properties / per_page / type
      Previous value: -"number"New value: +"integer"
    • changedOutput schema / properties / candidates / description
      Previous value: -"Candidate records with candidate_id, name, party, state, office, cycles, etc."New value: +"Candidate result set; one record per match."
    • changedOutput schema / properties / candidates / items / description
      Previous value: -"A candidate record (candidate_id, name, party, state, office, cycles, ...)."New value: +"Candidate record; common keys include candidate_id, name, party, state, office, and cycles."
    • changedOutput schema / properties / totals / items / description
      Previous value: -"A per-cycle financial totals row for a candidate committee."New value: +"Per-cycle financial totals row for a candidate committee."
  13. Changed2 schema fields changed
    • addedOutput schema / properties / candidates / items / description
      Added value: +"A candidate record (candidate_id, name, party, state, office, cycles, ...)."
    • addedOutput schema / properties / totals / items / description
      Added value: +"A per-cycle financial totals row for a candidate committee."
  14. Changed6 schema fields changed
    • addedOutput schema / properties / candidates / items / properties
      Added value: +{}
    • removedOutput schema / properties / candidates / items / propertyNames
      Removed value: -{
      -  "type": "string"
      -}
    • addedOutput schema / properties / search_criteria / properties
      Added value: +{}
    • removedOutput schema / properties / search_criteria / propertyNames
      Removed value: -{
      -  "type": "string"
      -}
    • addedOutput schema / properties / totals / items / properties
      Added value: +{}
    • removedOutput schema / properties / totals / items / propertyNames
      Removed value: -{
      -  "type": "string"
      -}
  15. First observed

TDQS

A3.5/5.0
Behavior3/5

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

The annotations already declare readOnlyHint and idempotentHint, so the safety profile is covered. The description adds mode-dependent behavior (the ID path returns one candidate with financial totals) and an ID format constraint, but says nothing about result volume, pagination defaults, or empty/single-match behavior on the search path.

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

Conciseness4/5

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

Three compact sentences with the primary function front-loaded, followed by the alternate retrieval mode and a format constraint. The ID-format sentence partially duplicates the candidate_id schema description, which keeps it from a perfect score.

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?

An output schema exists, so return values need not be explained. The dual-mode design of this 14-optional-parameter tool is covered by the description, with the only meaningful gaps being no-filter behavior and result-set expectations.

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 14 parameters are already documented in the schema, including the ID format and enum legends. The description restates the filter list and the H/S/P ID convention but adds no semantics beyond what the schema already provides, so the baseline 3 applies.

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 names a specific verb and resource ("Find federal candidates") and enumerates the filter dimensions plus a second retrieval mode by FEC ID. It is clear which sibling resource it covers (candidates vs. committees/contributions), though it never explicitly contrasts itself with those siblings by name.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: filter-based search when browsing, candidate_id when you already have an ID. There is no explicit guidance on when to use which mode, no exclusions, and no mention of what happens with zero filters supplied.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.