Skip to main content
Glama

get_document

Read-only

Retrieve a document's metadata, size, and structure-first flag to decide whether to read it directly or inspect its structure before reading.

Instructions

Get one document's metadata: title, description, frontmatter, size (lines, tokens) and read_structure_first (true for documents over 15000 tokens). Use it to decide how to read the document: small documents can be read directly from their top-level nodes, large ones need get_document_structure() first.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "doc_path": "<doc_path>"
    },
    "name": "get_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
doc_pathYesLibrary-relative path of the document, copied verbatim from a browse_documents() or search_documents() result (case-sensitive, include the extension). Example: "guides/setup.md". Never construct one.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.5/5.0
Behavior4/5

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

The annotations already declare that this is a safe read-only call. The description goes further by defining a concrete threshold (documents over 15000 tokens set read_structure_first=true), which is real behavioral context that the annotations do not provide. It does not cover failure modes, such as what happens with an invalid path, but that is a minor gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with no wasted words. The return contents come first, and the decision guidance comes second, which matches the order an agent needs them in.

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?

The description lists the returned fields even though no output schema exists, and it explains the one non-obvious field, read_structure_first. It also explains when to use this tool versus its sibling before reading further. An agent has everything it needs in order to call the tool correctly.

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

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, and the single doc_path parameter is thoroughly documented in the schema itself, including the verbatim-copy rule and an example. The description adds no parameter-level guidance beyond what the schema already says, so this dimension earns only the baseline score.

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 opens with a specific verb and resource ('Get one document's metadata') and enumerates exactly which fields come back (title, description, frontmatter, size, read_structure_first). That detail clearly separates it from get_document_structure and get_node_content, which return structure and content rather than metadata.

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?

It states the purpose of the call ('Use it to decide how to read the document') and gives an explicit decision rule: small documents can be read from top-level nodes, while large ones need get_document_structure() first. It names the alternative tool and the condition that selects it.

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