Skip to main content
Glama

Openfec Lookup Elections

openfec_lookup_elections
Read-onlyIdempotent

Look up federal election races and candidate financial summaries. Find who's running in a race with fundraising totals, or get an aggregate race summary.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
zipNoZIP code — finds races covering this ZIP. Search mode only.
modeNosearch = candidates in a race with financial totals. summary = aggregate race financial summary.search
pageNoPage number (1-indexed). Search mode only; explicit page is rejected in summary mode. Defaults to 1 for search.
cycleYesElection cycle year (even years only, e.g. 2024).
stateNoTwo-letter US state code (e.g., AZ, CA). Required for senate/house unless zip is provided.
officeYesOffice sought: H=House, S=Senate, P=President.
districtNoTwo-digit district number (e.g. "07"). Required for house unless zip is provided.
per_pageNoResults per page. Search mode only; defaults to 20.
election_fullNoExpand to full election period (4yr president, 6yr senate, 2yr house). Defaults to true when omitted; a ZIP-scoped search rejects it, since that endpoint has no such parameter. Carries no schema default, so an explicit value is distinguishable from an omission.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoQuery mode as the server resolved it. Row shapes differ by mode — search rows are per-candidate financial records, summary is one aggregate race row — so read this rather than inferring the shape from the fields present.
errorNoPresent when the call failed. Absent on success.
noticeNoGuidance when the response carries no election results: how to broaden a search that matched nothing, or which requested position ran out when results did match.
resultsNoElection race result set; candidate financial rows in search mode, a single aggregate summary row in summary mode.
paginationNoPage-based pagination metadata.
totalCountNoTotal matching candidates or race summaries.
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. Changed2 schema fields changed
    • changedOutput schema / properties / notice / description
      Previous value: -"Guidance when no election results matched — echoes filters and suggests how to broaden."New value: +"Guidance when the response carries no election results: how to broaden a search that matched nothing, or which requested position ran out when results 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"
      +}
  2. Changed1 schema field changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `cycle_must_be_even`: Cycle is an odd year `missing_state_for_office`: Senate or House office without a state and without a zip `missing_district_for_house`: House office without a district number and without a zip `summary_does_not_support_zip`: Summary mode invoked with a zip parameter `inputs_not_applicable_to_mode`: The resolved elections endpoint does not accept one or more explicitly supplied inputs Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `cycle_must_be_even`: Cycle is an odd year. `missing_state_for_office`: Senate or House office without a state and without a zip. `missing_district_for_house`: House office without a district number and without a zip. `summary_does_not_support_zip`: Summary mode invoked with a zip parameter. `inputs_not_applicable_to_mode`: The resolved elections endpoint does not accept one or more explicitly supplied inputs. Other values are possible when a failure originates below the handler."
  3. Changed5 schema fields changed
    • removedInput schema / properties / page / default
      Removed value: -1
    • changedInput schema / properties / page / description
      Previous value: -"Page number (1-indexed). Search mode only — summary mode returns a single aggregate row. Read pagination.pages in the response to see how many pages exist."New value: +"Page number (1-indexed). Search mode only; explicit page is rejected in summary mode. Defaults to 1 for search."
    • removedInput schema / properties / per_page / default
      Removed value: -20
    • changedInput schema / properties / per_page / description
      Previous value: -"Results per page. Search mode only."New value: +"Results per page. Search mode only; defaults to 20."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `cycle_must_be_even`: Cycle is an odd year `missing_state_for_office`: Senate or House office without a state and without a zip `missing_district_for_house`: House office without a district number and without a zip `summary_does_not_support_zip`: Summary mode invoked with a zip parameter `inputs_not_applicable_to_mode`: election_full supplied alongside zip — a ZIP-scoped search runs an endpoint that has no such parameter Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `cycle_must_be_even`: Cycle is an odd year `missing_state_for_office`: Senate or House office without a state and without a zip `missing_district_for_house`: House office without a district number and without a zip `summary_does_not_support_zip`: Summary mode invoked with a zip parameter `inputs_not_applicable_to_mode`: The resolved elections endpoint does not accept one or more explicitly supplied inputs Other values are possible when a failure originates below the handler."
  4. 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": [
      +      "results",
      +      "mode",
      +      "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: `cycle_must_be_even`: Cycle is an odd year `missing_state_for_office`: Senate or House office without a state and without a zip `missing_district_for_house`: House office without a district number and without a zip `summary_does_not_support_zip`: Summary mode invoked with a zip parameter `inputs_not_applicable_to_mode`: election_full supplied alongside zip — a ZIP-scoped search runs an endpoint that has no such parameter Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "cycle_must_be_even",
      +            "missing_state_for_office",
      +            "missing_district_for_house",
      +            "summary_does_not_support_zip",
      +            "inputs_not_applicable_to_mode"
      +          ],
      +          "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: -[
      -  "results",
      -  "mode",
      -  "pagination",
      -  "search_criteria",
      -  "totalCount"
      -]
  5. Changed5 schema fields changed
    • removedInput schema / properties / election_full / default
      Removed value: -true
    • changedInput schema / properties / election_full / description
      Previous value: -"Expand to full election period (4yr president, 6yr senate, 2yr house). Default true. Ignored for ZIP-based searches."New value: +"Expand to full election period (4yr president, 6yr senate, 2yr house). Defaults to true when omitted; a ZIP-scoped search rejects it, since that endpoint has no such parameter. Carries no schema default, so an explicit value is distinguishable from an omission."
    • addedOutput schema / properties / mode
      Added value: +{
      +  "description": "Query mode as the server resolved it. Row shapes differ by mode — search rows are per-candidate financial records, summary is one aggregate race row — so read this rather than inferring the shape from the fields present.",
      +  "enum": [
      +    "search",
      +    "summary"
      +  ],
      +  "type": "string"
      +}
    • 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: -[
      -  "results",
      -  "pagination",
      -  "totalCount"
      -]New value: +[
      +  "results",
      +  "mode",
      +  "pagination",
      +  "search_criteria",
      +  "totalCount"
      +]
  6. Changed2 schema fields changed
    • addedInput schema / properties / page
      Added value: +{
      +  "default": 1,
      +  "description": "Page number (1-indexed). Search mode only — summary mode returns a single aggregate row. Read pagination.pages in the response to see how many pages exist.",
      +  "maximum": 9007199254740991,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / per_page
      Added value: +{
      +  "default": 20,
      +  "description": "Results per page. Search mode only.",
      +  "maximum": 100,
      +  "minimum": 1,
      +  "type": "integer"
      +}
  7. Changed3 schema fields changed
    • addedOutput schema / properties / notice
      Added value: +{
      +  "description": "Guidance when no election results matched — echoes filters and suggests how to broaden.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / totalCount
      Added value: +{
      +  "description": "Total matching candidates or race summaries.",
      +  "type": "number"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "results",
      -  "pagination"
      -]New value: +[
      +  "results",
      +  "pagination",
      +  "totalCount"
      +]
  8. Changed6 schema fields changed
    • changedInput schema / properties / office / description
      Previous value: -"Office sought: president, senate, or house."New value: +"Office sought: H=House, S=Senate, P=President."
    • changedInput schema / properties / office / enum
      Previous value: -[
      -  "president",
      -  "senate",
      -  "house"
      -]New value: +[
      +  "H",
      +  "S",
      +  "P"
      +]
    • changedOutput schema / properties / pagination / properties / page / description
      Previous value: -"Current page number."New value: +"Current page number (1-indexed)."
    • changedOutput schema / properties / pagination / properties / pages / description
      Previous value: -"Total pages available."New value: +"Total number of pages."
    • changedOutput schema / properties / results / description
      Previous value: -"Election race records — candidates with financial data, or aggregate summary."New value: +"Election race result set; candidate financial rows in search mode, a single aggregate summary row in summary mode."
    • changedOutput schema / properties / results / items / description
      Previous value: -"An election race record (candidate financial row or aggregate summary)."New value: +"Candidate financial row (search mode) or aggregate race summary (summary mode)."
  9. Changed1 schema field changed
    • addedOutput schema / properties / results / items / description
      Added value: +"An election race record (candidate financial row or aggregate summary)."
  10. Changed4 schema fields changed
    • addedOutput schema / properties / results / items / properties
      Added value: +{}
    • removedOutput schema / properties / results / items / propertyNames
      Removed value: -{
      -  "type": "string"
      -}
    • addedOutput schema / properties / search_criteria / properties
      Added value: +{}
    • removedOutput schema / properties / search_criteria / propertyNames
      Removed value: -{
      -  "type": "string"
      -}
  11. First observed

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, so the safety profile is covered. The description adds the behavioral distinction between search and summary modes, and the schema adds mode-specific constraints (e.g., page rejected in summary mode, ZIP-scoped search rejects election_full). However, the description itself doesn't disclose these mode-specific behaviors; they live in the schema. No contradiction with annotations.

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?

Two sentences, front-loaded with the core purpose and a brief mode distinction. It is concise and readable, though the second sentence could arguably be folded into the first. No wasted words.

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?

The tool has 9 parameters, an output schema, and mode-specific constraints. The description covers the high-level purpose and the two modes, but it doesn't mention the ZIP vs state/district routing logic or the mode-specific parameter rejections, which are important for correct invocation. The schema carries most of the burden, and the output schema exists, so this is adequate but not complete.

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 the schema already documents all 9 parameters. The description adds a high-level framing ('search = candidates in a race with financial totals, summary = aggregate race financial summary') that helps interpret mode, but it doesn't add meaning beyond the schema for most parameters. Baseline 3 is appropriate.

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 states a specific verb ('look up') and resource ('federal election races and candidate financial summaries'), and distinguishes two modes: finding who's running with fundraising totals, or getting an aggregate race summary. It doesn't explicitly name a sibling to differentiate from, but the resource and modes are clear enough to separate it from the sibling search tools.

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?

The description implies usage by describing the two modes ('search' vs 'summary') and what each returns, but it doesn't explicitly state when to prefer this tool over siblings like openfec_search_candidates. The schema provides some guidance (e.g., zip vs state/district requirements), but the description itself offers no when-to-use or when-not-to-use guidance.

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.