Skip to main content
Glama

Openfec Get Legal Document

openfec_get_legal_document
Read-onlyIdempotent

Fetch one FEC legal document — advisory opinion, MUR, ADR, administrative fine, or statute — by its type and number. openfec_search_legal replaces each result's documents and dispositions arrays with a count and category summary and cuts every commission vote down to a date and a 200-character action; this returns the record as upstream sends it, whole when it fits the 100,000-byte response budget. A larger record returns its scalar fields and the arrays that fit, with the rest listed in withheld; page through one by re-calling with array and offset. doc_type is the plural form of the document_type discriminator on a search result (advisory_opinion becomes advisory_opinions, mur becomes murs, adr becomes adrs, admin_fine becomes admin_fines, statute becomes statutes), and no is that result's no field — every document type carries it, and advisory opinions repeat it as ao_no.

Input Schema

NameRequiredDescriptionDefault
noYesDocument number, copied from the no field of the matching openfec_search_legal result. Advisory opinions are year-serial (e.g. "2024-01", also repeated as ao_no); murs, adrs, and admin_fines are digit strings (e.g. "8363"); statutes are U.S. Code section numbers (e.g. "30123").
arrayNoName of one top-level array field of the record to page through by entry — usually one listed in withheld when the record was too large to return whole (e.g. "dispositions", "documents"). Returns that array's entries from offset while they fit the response budget, in slice, with the record's scalar fields. Omit to fetch the record itself.
offsetNoEntry offset (0-indexed) into array. Requires array; defaults to 0 when array is given. Pass the next_offset a previous slice returned to continue.
doc_typeYesLegal document type, always plural. openfec_search_legal reports the singular form in each result document_type — advisory_opinion, mur, adr, admin_fine, statute — so add an "s" to get the value this field wants.

Output Schema

NameRequiredDescriptionDefault
errorNoPresent when the call failed. Absent on success.
sliceNoA run of the requested array. Present only when array was given.
noticeNoHow to continue: which arrays were held back and how to page them, where a slice continues, or that an offset ran past the end of its array.
documentNoThe legal document record, fields as upstream sends them — the full documents array openfec_search_legal summarizes, the complete dispositions and commission_votes entries, and the scalar and date fields (name, type, url, penalty and determination amounts, case dates). Whole when it fits the 100,000-byte response budget; otherwise the scalar fields and the arrays that fit, with the rest in withheld. With array set, the record's non-array fields only — the entries are in slice. Fields present vary by document type.
withheldNoArrays held back from document because the whole record exceeds the 100,000-byte response budget, smallest first. Page through one by re-calling with array set to its name. Absent when document is the whole record.
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.
attachedDocumentCountNoNumber of related filings in the record documents array — the full count, whether this response carries them in document, in a slice, or holds them back. Compare against the document_count openfec_search_legal reported for the same record.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changed
    • addedInput schema / properties / array
      Added value: +{
      +  "description": "Name of one top-level array field of the record to page through by entry — usually one listed in withheld when the record was too large to return whole (e.g. \"dispositions\", \"documents\"). Returns that array's entries from offset while they fit the response budget, in slice, with the record's scalar fields. Omit to fetch the record itself.",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / offset
      Added value: +{
      +  "description": "Entry offset (0-indexed) into array. Requires array; defaults to 0 when array is given. Pass the next_offset a previous slice returned to continue.",
      +  "maximum": 9007199254740991,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • changedOutput schema / properties / attachedDocumentCount / description
      Previous value: -"Number of related filings in the record documents array. Compare against the document_count openfec_search_legal reported for the same record."New value: +"Number of related filings in the record documents array — the full count, whether this response carries them in document, in a slice, or holds them back. Compare against the document_count openfec_search_legal reported for the same record."
    • changedOutput schema / properties / document / description
      Previous value: -"The complete legal document record. Carries the full documents array that openfec_search_legal replaces with a count and category summary, and the complete commission_votes entries it reduces to a vote date and a truncated action, alongside the dispositions and the scalar and date fields (name, type, url, penalty and determination amounts, case dates). Fields present vary by document type."New value: +"The legal document record, fields as upstream sends them — the full documents array openfec_search_legal summarizes, the complete dispositions and commission_votes entries, and the scalar and date fields (name, type, url, penalty and determination amounts, case dates). Whole when it fits the 100,000-byte response budget; otherwise the scalar fields and the arrays that fit, with the rest in withheld. With array set, the record's non-array fields only — the entries are in slice. Fields present vary by document type."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `legal_document_not_found`: No legal document exists at the requested doc_type and document number. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `legal_document_not_found`: No legal document exists at the requested doc_type and document number. `array_not_in_record`: The array input names a field this record does not carry as an array. `offset_without_array`: offset was given without array, so there is no array for it to index. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "legal_document_not_found"
      -]New value: +[
      +  "legal_document_not_found",
      +  "array_not_in_record",
      +  "offset_without_array"
      +]
    • addedOutput schema / properties / notice
      Added value: +{
      +  "description": "How to continue: which arrays were held back and how to page them, where a slice continues, or that an offset ran past the end of its array.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / slice
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "A run of the requested array. Present only when array was given.",
      +  "properties": {
      +    "array": {
      +      "description": "The array these entries come from.",
      +      "type": "string"
      +    },
      +    "entries": {
      +      "description": "Entries from offset, as many as fit the response budget — at least one while offset is inside the array.",
      +      "items": {
      +        "description": "One entry, exactly as the record carries it."
      +      },
      +      "type": "array"
      +    },
      +    "next_offset": {
      +      "description": "Offset that continues the array. Absent once the last entry is here.",
      +      "type": "number"
      +    },
      +    "offset": {
      +      "description": "Offset (0-indexed) of the first entry here.",
      +      "type": "number"
      +    },
      +    "total": {
      +      "description": "Entries in the whole array.",
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "array",
      +    "offset",
      +    "total",
      +    "entries"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / withheld
      Added value: +{
      +  "description": "Arrays held back from document because the whole record exceeds the 100,000-byte response budget, smallest first. Page through one by re-calling with array set to its name. Absent when document is the whole record.",
      +  "items": {
      +    "additionalProperties": false,
      +    "description": "One array held back from document.",
      +    "properties": {
      +      "array": {
      +        "description": "Name of the array field held back — pass it as array.",
      +        "type": "string"
      +      },
      +      "bytes": {
      +        "description": "Size of the whole array as JSON, in UTF-8 bytes.",
      +        "type": "number"
      +      },
      +      "count": {
      +        "description": "Entries in the array.",
      +        "type": "number"
      +      }
      +    },
      +    "required": [
      +      "array",
      +      "count",
      +      "bytes"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  2. Changed1 schema field changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `legal_document_not_found`: No legal document exists at the requested doc_type and no Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `legal_document_not_found`: No legal document exists at the requested doc_type and document number. Other values are possible when a failure originates below the handler."
  3. 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": [
      +      "document",
      +      "search_criteria",
      +      "attachedDocumentCount"
      +    ]
      +  },
      +  {
      +    "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: `legal_document_not_found`: No legal document exists at the requested doc_type and no Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "legal_document_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: -[
      -  "document",
      -  "search_criteria",
      -  "attachedDocumentCount"
      -]
  4. Added

TDQS

A5/5.0
Behavior5/5

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

Beyond the readOnlyHint and idempotentHint annotations, the description discloses substantial behavioral detail: a 100,000-byte response budget, partial return of scalar fields and arrays, a withheld list for omitted data, and offset-based paging. This lets an agent anticipate truncated responses and plan follow-up calls without experimental discovery.

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 dense but every sentence earns its place: the first states purpose, the second explains the relationship to the sibling tool, and the third covers parameter conventions. It is front-loaded with the core action and keeps related details grouped coherently.

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

Completeness5/5

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

Given the tool's complexity, the description covers the key behaviors an agent needs: full versus truncated records, the withheld field, paging via array and offset, and how to derive parameters from a sibling tool's result. An output schema exists, so the lack of a canned return-value description is acceptable.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although the schema already covers all parameters at 100%, the description adds essential cross-tool semantics: doc_type is the plural form of the search result's document_type discriminator, and no mirrors the result's no field (with advisory opinions repeating it as ao_no). It also clarifies that every document type carries no, reducing ambiguity that raw schema descriptions leave open.

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?

The description opens with a specific verb and resource: 'Fetch one FEC legal document — advisory opinion, MUR, ADR, administrative fine, or statute — by its type and number.' It clearly differentiates itself from the sibling openfec_search_legal by explaining that this tool returns the raw, upstream record rather than the search result's summarized form.

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

Usage Guidelines5/5

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

The description explicitly contrasts this tool with openfec_search_legal: the search tool aggregates and truncates fields, while this tool returns the full record as upstream sends it. It also gives concrete guidance for handling oversized records by re-calling with array and offset, so an agent knows exactly when and how to page.

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.