Skip to main content
Glama
fairquery-agent-trust-mcp

fairquery-agent-trust-mcp

Official

Get SEC filing document text

edgar_get_filing_document
Read-onlyIdempotent

Fetch and page through SEC EDGAR filing documents as plain text by document URL or company plus accession number, so you can read risk factors, MD&A, and press releases.

Instructions

WHAT: Fetch the text of one SEC filing document from the EDGAR archives, converted from HTML to plain text and returned in character-paged chunks. WHEN: To read the content of a filing (risk factors, MD&A, an 8-K press release). Identify it by documentUrl from edgar_list_filings, or by company + accessionNumber (the primary document, unless document names another file in that filing). WHEN NOT: To find which filings exist, use edgar_list_filings first. For structured financial values use edgar_get_company_facts. COST: Free. Direct sec.gov requests from this MCP server. No APIFY_TOKEN and no Apify billing. RETURNS: One page of text. nextOffset is null on the last page. Errors: INVALID_INPUT, INVALID_URL, COMPANY_NOT_FOUND, FILING_NOT_FOUND, NOT_FOUND, SEC_FETCH_FAILED (retryable). BEHAVIOR: HTTPS only to www.sec.gov and data.sec.gov. User-Agent is "Fairquery info@getfairquery.com". At most 5 requests/second, shared by every free edgar_* tool. Redirects are refused. Responses are size-capped. The ticker map is cached for 6 hours. APIFY_TOKEN is not read. Large 10-Ks can exceed 500,000 characters; read them in pages. HTML and XML are converted to text unless raw is true. .htm files are treated as HTML even when the content type is missing. PARAMETERS: Give either documentUrl (it wins; company, accessionNumber and document are then ignored) or company + accessionNumber (both required, otherwise INVALID_INPUT). documentUrl must start with https://www.sec.gov/Archives/ (otherwise INVALID_URL). accessionNumber accepts dashed "0000320193-24-000123" or 18 digits. Without document, the filing's primary document is fetched (recent filings, then archived). document is a single file name in that folder, such as "ex99-1.htm", not a path. offset and maxChars are characters of the converted text, or of the raw body when raw is true. Loop with offset = nextOffset until hasMore is false. Do not mix offsets from raw and text mode. .txt files are returned unchanged in either mode. EXAMPLE: {"company":"AAPL","accessionNumber":"0000320193-24-000123","maxChars":20000} -> the first 20000 characters of the 10-K text, with nextOffset for the next page.

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": "edgar_get_filing_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
rawNoOptional boolean, default false. true returns the raw HTML/XML body instead of extracted plain text (offsets then refer to the raw body)
offsetNoOptional integer >= 0, default 0. Character offset into the (converted) document to start from; pass nextOffset from the previous page. Example: 20000
companyNoOptional, 1-200 chars; required together with accessionNumber when documentUrl is omitted, ignored when documentUrl is given. Ticker ("AAPL"), CIK ("320193") or registrant-name fragment ("Apple"; the first SEC ticker-map match is used).
documentNoOptional, <= 200 chars, used only with company + accessionNumber. Single file name inside the filing folder, e.g. "ex99-1.htm" (not a path). Default: the primary document
maxCharsNoOptional integer 500-100000, default 20000. Max characters returned in this page. Example: 50000
documentUrlNoOptional (alternative to company + accessionNumber). Full URL that must start with https://www.sec.gov/Archives/ (else INVALID_URL), usually document_url from edgar_list_filings. Example: https://www.sec.gov/Archives/edgar/data/320193/000032019324000123/aapl-20240928.htm
accessionNumberNoOptional; required together with company when documentUrl is omitted. Format 10-2-6 digits with optional dashes (pattern ^\d{10}-?\d{2}-?\d{6}$), e.g. "0000320193-24-000123" or "000032019324000123"

Output Schema

NameRequiredDescriptionDefault
textYes
offsetYes
hasMoreYes
nextOffsetYes
total_charsYes
content_typeYes
document_urlYes
returned_charsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.1.2

TDQS

A4.9/5.0
Behavior5/5

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

Goes well beyond the annotations: names the exact host allowlist (www.sec.gov, data.sec.gov), the User-Agent string, a 5 req/s shared rate limit, redirect refusal, size caps, 6-hour ticker-map caching, and the full error code list including which is retryable. It also warns that large 10-Ks exceed 500,000 characters and must be paged, and explains raw-vs-text conversion rules including the .htm-with-missing-content-type edge case.

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?

Labeled sections (WHAT/WHEN/WHEN NOT/COST/RETURNS/BEHAVIOR/PARAMETERS/EXAMPLE) make it scannable and the most decision-relevant routing information is front-loaded. It is nonetheless long and the PARAMETERS block partly restates constraints already in the schema, so it falls short of zero-waste.

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?

For a zero-required-param fetch tool with an output schema, this covers everything an agent needs: discovery precondition, cost/auth posture, rate limits, error taxonomy, conversion semantics, and the paging loop. Nothing needed to invoke it correctly is left to inference.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds precedence rules the schema does not make obvious (documentUrl wins and causes company/accessionNumber/document to be ignored), mutual-requirement failure modes (INVALID_INPUT, INVALID_URL), the accession-number format tolerance, and that document is a bare file name not a path. It also defines the paging contract (loop offset = nextOffset until hasMore is false; never mix offsets between raw and text mode).

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?

States a specific verb and resource ('Fetch the text of one SEC filing document from the EDGAR archives') plus the transformation applied (HTML to plain text, chunked by characters). It distinguishes itself from siblings by naming edgar_list_filings for discovery and edgar_get_company_facts for structured values.

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 WHEN and WHEN NOT blocks explicitly route the agent: read filing content here, discover filings with edgar_list_filings first, and use edgar_get_company_facts for structured financials. Concrete reading scenarios (risk factors, MD&A, 8-K press release) are given.

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