Skip to main content
Glama

Get metadata for a filing document before downloading it

get_document_metadata
Read-onlyIdempotent

Retrieve metadata for a filing document by its document_id to check available formats, page count, size, and source URL before downloading. Use this to decide whether to fetch inline or hand the URL to the user.

Instructions

Retrieve metadata about a filing document by its document_id (obtained from list_filings). Returns available content formats with byte sizes (when known), page count, source URL, and creation date. Raw upstream fields come through verbatim under jurisdiction_data.

Call this before fetch_document when the document might be large or you don't yet know the format — it lets you decide whether to download inline or hand the source_url to the user.

Do NOT construct or guess document_id values — some registries use composite IDs (multi-part, colon- or slash-separated) that must come from a previous list_filings response. Synthesized IDs will 404 or 502.

available_formats may be empty when the body is paywalled or the registry doesn't publish bodies at all — in those cases fetch_document returns 501 / a purchase link. Unsupported jurisdictions return 501. Per-country ID format, pricing, and availability — call list_jurisdictions({jurisdiction:"<code>"}).

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 a previous list_filings call.
freshNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
queried_atYesISO-8601 + Europe/London timezone stamp for when the registry was queried.
jurisdictionNo
document_idNo
source_urlNo
created_atNo
pagesNo
available_formatsNo
size_bytes_by_formatNo
Behavior4/5

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

Annotations declare readOnlyHint, idempotentHint, and no destructive behavior. The description adds context: returning raw upstream fields under jurisdiction_data, potential empty formats, and error codes (404, 502, 501). However, it could be more explicit about side effects or rate limits, though the annotations cover safety.

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?

Description is comprehensive but slightly verbose with the full URL format in comments. Key points are front-loaded (purpose, return fields). Minor redundancy in repeating unsupported jurisdiction info from list_jurisdictions.

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 (metadata for filings with many edge cases), the description covers purpose, inputs, expected outputs, error scenarios, and references to other tools. Output schema exists (though not shown here), reducing need to detail return values. Complete for an experienced agent.

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 67% (descriptions for jurisdiction and document_id, but fresh lacks description). The description explains document_id must come from list_filings (not constructed), and jurisdiction references list_jurisdictions for capability, complementing schema. The fresh parameter is not addressed; left to schema default.

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 the tool retrieves metadata for a filing document by document_id from list_filings, specifying returned fields like formats, page count, source URL, and date. It distinguishes itself from sibling fetch_document by stating it should be called before downloading to decide on format or size.

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?

Explicitly says to call this before fetch_document for large documents or unknown format, and advises not to construct document_id values. It also explains edge cases like empty available_formats (paywalled) and unsupported jurisdictions returning 501, and references list_jurisdictions for per-country details.

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