Skip to main content
Glama

Get SEC filing document text

edgar_get_filing_document
Read-onlyIdempotent

Fetch the text of an SEC filing document from EDGAR, converted to plain text and paged in character chunks for reading risk factors, MD&A, or press releases.

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: free, read-only GET to www.sec.gov (no token). Large 10-Ks can exceed 500k characters; read them in pages with offset/maxChars (nextOffset is returned). Only https://www.sec.gov/Archives/ URLs are accepted. RETURNS: {document_url,content_type,total_chars,offset,returned_chars,hasMore,nextOffset,text}. Errors: INVALID_URL, COMPANY_NOT_FOUND, FILING_NOT_FOUND, NOT_FOUND, SEC_FETCH_FAILED. 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.

Input Schema

TableJSON 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
companyNoRequired, 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.
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

TableJSON Schema
NameRequiredDescriptionDefault
textYes
offsetYes
hasMoreYes
nextOffsetYes
total_charsYes
content_typeYes
document_urlYes
returned_charsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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)"
  2. Addedv1.2.1

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/openWorld/non-destructive, but the description adds substantial context beyond them: no token or Apify billing, only https://www.sec.gov/Archives/ URLs accepted, documents can exceed 500k characters and must be paged, raw vs text modes use incompatible offsets, .txt files are passed through unchanged, and the specific error codes emitted.

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?

Front-loaded and cleanly sectioned (Behavior, RETURNS, WHEN NOT TO USE, COST, PARAMETERS, EXAMPLE), and almost every sentence carries operational value. Minor waste: the COST line repeats the earlier 'free ... no token' claim, and RETURNS largely restates the output schema.

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, paging-capable tool with an output schema, the description covers identification precedence, paging mechanics, mode-switching pitfalls, and failure modes. An agent has everything needed to call it correctly on the first attempt.

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 would be 3, but the description adds real meaning: documentUrl wins over company/accessionNumber, company+accessionNumber must be supplied together, accession accepts dashed or 18-digit forms, document defaults to the primary document within the same folder, and offset/maxChars are character-based so callers must loop on nextOffset.

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 (fetch) plus resource (SEC filing document text) and scope (sec.gov EDGAR archives, HTML converted to plain text, character-paged). It explicitly separates 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?

Has an explicit 'Use to read the actual content of a filing' statement plus a dedicated 'WHEN NOT TO USE' block that names the two correct alternatives for discovery and structured facts. It also specifies the two mutually exclusive identification paths and the error returned if they are mixed incorrectly.

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