Skip to main content
Glama

Fetch document

fetch_document
Read-onlyIdempotent

Retrieve the full content of a corporate filing document by its ID. Returns the document bytes or a link for oversized files, enabling direct access to the numbers and text inside.

Instructions

Read a filing's content by document_id (from list_filings). Filing metadata alone doesn't answer most questions — the numbers and text live inside the document.

RESPONSE SHAPES: • kind='embedded' (under max_bytes ≈ 20 MB) — returns full bytes_base64, source_url_official (evergreen registry URL), and source_url_direct (short-TTL signed proxy URL). PDFs render as a document block you can read natively. • kind='resource_link' (oversized) — NO bytes_base64. Returns reason, next_steps, both source URLs, and index_preview {page_count, text_layer, outline_present}. Use get_document_navigation to locate pages, then re-call this tool with pages='N-M' and format='pdf'|'text'|'png' for the content.

CRITICAL: if this tool fails (rate limit, 5xx, timeout), do NOT fill in names / numbers / dates from memory — tell the user what failed and offer retry or source_url_official. Outline titles, previews, and snippets from navigation tools are for LOCATING pages, never for quoting.

source_url_official is auto-resolved from the most recent list_filings call; the optional company_id / transaction_id / filing_type / filing_description inputs are overrides for the rare case where document_id didn't come through list_filings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jurisdictionYesISO 3166-1 alpha-2 country code (uppercase). All registries are official government sources. Currently supported: AU, BE, CA, CA-BC, CA-NT, CH, CY, CZ, DE, ES, FI, FR, GB, HK, IE, IM, IS, IT, KR, KY, LI, MC, MX, MY, NL, NO, NZ, PL, RU, TW. Per-country capability, ID format, examples, status mapping, and caveats: call `list_jurisdictions({jurisdiction:'<code>'})`. To find which countries support a specific tool: `list_jurisdictions({supports_tool:'<tool>'})`.
document_idYesDocument ID from list_filings; do not synthesize (composite IDs will 404).
formatNoPreferred content type: application/xhtml+xml, application/pdf, application/xml, application/json. Omit to let the adapter pick the most structured option (XHTML > XML > JSON > PDF).
max_bytesNoInline-size cutoff. Default ~20 MB. Documents above this return as `kind='resource_link'` — call `get_document_navigation` for them.
freshNoBypass R2 cache. Filings are immutable; rarely needed.
company_idNoOverride; auto-resolved from list_filings side-cache.
transaction_idNoOverride; auto-resolved from list_filings side-cache.
filing_typeNoOverride; auto-resolved from list_filings side-cache.
filing_descriptionNoOverride; auto-resolved from list_filings side-cache.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
queried_atYesISO-8601 + Europe/London timezone stamp for when the registry was queried.
jurisdictionNo
document_idNo
source_urlNo
available_formatsNo
chosen_formatNo
size_bytesNo
pagesNo
bytes_base64No
bytes_omitted_reasonNo
Behavior5/5

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

Annotations already declare readOnlyHint, destructiveHint, idempotentHint, openWorldHint. The description adds detailed response shapes, behavior for oversized documents, and instructions on not quoting from navigation tools. No contradictions.

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?

The description is long but well-structured with sections and front-loaded purpose. Some redundancy exists, but it remains efficient for the complexity.

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 (9 params, output schema), the description covers error behavior, response types, oversized documents, and usage with sibling tools. The output schema likely documents return values, so no gap.

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%, baseline 3. The description adds meaning beyond the schema by explaining the purpose of document_id, the effect of max_bytes, and the role of override parameters.

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 clearly states that the tool reads a filing's content by document_id. It distinguishes itself from siblings like list_filings (metadata) and get_document_navigation (navigation).

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

Usage Guidelines4/5

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

The description explains when to use the tool (to get actual content) and provides critical instructions for failure scenarios. It does not explicitly state when not to use it, but the context is clear.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sophymarine/openregistry'

If you have feedback or need assistance with the MCP directory API, please join our Discord server