Skip to main content
Glama

Get SEC filing document text

edgar_get_filing_document
Read-onlyIdempotent

Fetch SEC filing text from EDGAR in paged chunks to read risk factors, MD&A, or 8-K content. Identify by document URL or company + accession number.

Instructions

Fetch the text of an SEC filing document from the sec.gov EDGAR archives, converted from HTML to plain text, returned in character-paged chunks. Use to read the actual content of a filing (risk factors, MD&A, 8-K press release, ...). Identify the document by documentUrl (from edgar_list_filings), or by company + accessionNumber (the primary document is used unless document names another file in the filing). Behavior: GET to www.sec.gov (throttled to <=5 requests/s). Large 10-Ks can exceed 500k characters, so read them in pages. 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). WHEN NOT TO USE: to find which filings exist use edgar_list_filings first; for structured financial values use edgar_get_company_facts (no text parsing needed). COST: free - direct sec.gov requests from this MCP server, no APIFY_TOKEN, no Apify billing. PARAMETERS: give EITHER documentUrl (wins if present; company/accessionNumber/document are then ignored) OR company + accessionNumber (both required together, else INVALID_INPUT). accessionNumber accepts dashed "0000320193-24-000123" or 18 plain digits; without document the filing's primary document is fetched (looked up in recent, then archived filings), with document that file name inside the same filing folder is fetched directly (e.g. an exhibit "ex99-1.htm" listed on index_url). offset and maxChars are measured in characters of the converted text (or of the raw body when raw=true), not bytes: loop with offset = nextOffset until hasMore is false. raw=true returns the original HTML/XML unchanged, so total_chars and offsets differ from text mode; do not mix offsets from the two modes. Non-HTML files (.txt) are returned as is in either mode. EXAMPLE: {"company":"AAPL","accessionNumber":"0000320193-24-000123","maxChars":20000} -> first 20000 chars 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. File name inside the filing folder to fetch instead of the primary document, e.g. "ex99-1.htm". Default: 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. Changed1 schema field changedv1.2.5
    • changedInput schema / properties / company / description
      Previous value: -"Required, 1-200 chars. Ticker (\"AAPL\", case-insensitive), CIK of 1-10 digits (\"320193\" or \"0000320193\"; any SEC filer, even without a ticker) or registrant-name fragment (\"Apple\"; the first SEC ticker-map match is used). Call edgar_resolve_company first if a name is ambiguous."New value: +"Optional, 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)."
  2. Changed7 schema fields changedv1.2.2
    • changedInput schema / properties / accessionNumber / description
      Previous value: -"Accession number, e.g. \"0000320193-24-000123\" (requires company)"New value: +"Optional; 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\""
    • changedInput schema / properties / company / description
      Previous value: -"Ticker (\"AAPL\"), CIK (\"320193\", zero-padding optional) or company name fragment (\"Apple\"); best match is used. Call edgar_resolve_company first if the name is ambiguous."New value: +"Required, 1-200 chars. Ticker (\"AAPL\", case-insensitive), CIK of 1-10 digits (\"320193\" or \"0000320193\"; any SEC filer, even without a ticker) or registrant-name fragment (\"Apple\"; the first SEC ticker-map match is used). Call edgar_resolve_company first if a name is ambiguous."
    • changedInput schema / properties / document / description
      Previous value: -"File name inside the filing to fetch instead of the primary document, e.g. \"ex99-1.htm\""New value: +"Optional, <= 200 chars, used only with company + accessionNumber. File name inside the filing folder to fetch instead of the primary document, e.g. \"ex99-1.htm\". Default: primary document"
    • changedInput schema / properties / documentUrl / description
      Previous value: -"Full sec.gov Archives URL, e.g. https://www.sec.gov/Archives/edgar/data/320193/000032019324000123/aapl-20240928.htm"New value: +"Optional (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"
    • changedInput schema / properties / maxChars / description
      Previous value: -"Max characters to return (default 20000, max 100000)"New value: +"Optional integer 500-100000, default 20000. Max characters returned in this page. Example: 50000"
    • changedInput schema / properties / offset / description
      Previous value: -"Character offset to start from (default 0)"New value: +"Optional integer >= 0, default 0. Character offset into the (converted) document to start from; pass nextOffset from the previous page. Example: 20000"
    • changedInput schema / properties / raw / description
      Previous value: -"Return raw HTML instead of extracted text (default false)"New value: +"Optional boolean, default false. true returns the raw HTML/XML body instead of extracted plain text (offsets then refer to the raw body)"
  3. Addedv1.2.1

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/openWorld, but the description goes well beyond them: the throttle ceiling (<=5 requests/s), the reason pagination is needed (10-Ks exceeding 500k characters), the full error enumeration with SEC_FETCH_FAILED flagged retryable, and the cost model (free, no APIFY_TOKEN). It also warns that raw and text modes use incompatible offset spaces.

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?

Long, but front-loaded and partitioned into labeled sections (Behavior, RETURNS, WHEN NOT TO USE, COST, PARAMETERS, EXAMPLE) so a reader can jump straight to what matters. A few lines restate schema content, which costs it the top score, but almost every sentence carries distinct information.

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 7-parameter, zero-required paging tool with mutually exclusive identification paths, the definition covers everything needed: both input modes, precedence, unit semantics, the loop termination condition, raw-mode divergence, error handling, and cost. With an output schema present, it correctly avoids over-explaining the response payload.

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

Parameters4/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 genuine meaning: the precedence rule ('documentUrl wins if present; company/accessionNumber/document are then ignored'), the requirement that company and accessionNumber be supplied together or INVALID_INPUT results, the paging loop ('offset = nextOffset until hasMore is false'), and that .txt files bypass HTML conversion in either 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 an SEC filing document from the sec.gov EDGAR archives') plus the transformation applied (HTML to plain text) and the delivery shape (character-paged chunks). It explicitly contrasts itself with edgar_list_filings (discovery) and edgar_get_company_facts (structured values), so an agent can route correctly without opening any schema.

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?

Contains a dedicated WHEN NOT TO USE clause naming both relevant siblings and the condition that selects each ('to find which filings exist use edgar_list_filings first; for structured financial values use edgar_get_company_facts'). The two valid identification paths (documentUrl OR company + accessionNumber) are also stated as explicit alternatives.

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