Skip to main content
Glama

get_document

Read-onlyIdempotent

Fetch a complete knowledge document by repository path, including metadata, content hash, and links, to read full sources, follow references, or prepare updates.

Instructions

Return one knowledge document in full (title, tags, the complete source file with front matter, its content_hash, last-updated date, and the documents it links to and is linked from) by the doc_path given in search or bundle results. Use it when a section is not enough, to follow a link, or before proposing an update: to edit a document, change source and pass the full result to propose_update with base_content_hash = content_hash. Read-only; not-found for unknown paths, forbidden outside the requested scopes.

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
scopesNoOptional guard: the document must belong to one of these scopes, otherwise the call is refused.
doc_pathYesRepository-relative path of the document exactly as returned in doc_path, e.g. domain/rules/refunds.md. Required.

Output Schema

NameRequiredDescriptionDefault
pathYes
tagsYes
linksNo
scopeYes
titleYes
sourceNo
tokensYes
contentYes
backlinksNo
content_hashYes
front_matterYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.9.1
    • addedOutput schema / properties / content_hash
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / front_matter
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / source
      Added value: +{
      +  "type": "string"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "path",
      -  "scope",
      -  "title",
      -  "tags",
      -  "content",
      -  "tokens"
      -]New value: +[
      +  "path",
      +  "scope",
      +  "title",
      +  "tags",
      +  "content",
      +  "content_hash",
      +  "front_matter",
      +  "tokens"
      +]
  2. Changed2 schema fields changedv0.6.0
    • addedOutput schema / properties / backlinks
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": [
      +    "null",
      +    "array"
      +  ]
      +}
    • addedOutput schema / properties / links
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": [
      +    "null",
      +    "array"
      +  ]
      +}
  3. Changed2 schema fields changedv0.5.0
    • changedInput schema / properties / doc_path / description
      Previous value: -"Repository-relative path of the document, e.g. domain/rules/refunds.md"New value: +"Repository-relative path of the document exactly as returned in doc_path, e.g. domain/rules/refunds.md. Required."
    • changedInput schema / properties / scopes / description
      Previous value: -"If given, the document must belong to one of these scopes"New value: +"Optional guard: the document must belong to one of these scopes, otherwise the call is refused."
  4. First observedv0.4.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint and idempotentHint, but the description adds failure modes that annotations cannot express: not-found for unknown paths and refusal (forbidden) when the document falls outside the requested scopes. It also documents the mutation workflow dependency (base_content_hash = content_hash), which is behavioral context an agent needs to act correctly.

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?

Two sentences, front-loaded with the return payload, then the usage and workflow guidance. The long parenthetical enumeration of return fields is dense but every clause carries information; the only minor cost is readability of the run-on first sentence.

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?

A read tool with 2 params, full schema coverage, an output schema, and annotations needs nothing more: the description covers what is returned, the key provenance, error behavior, and the edit handoff. No gap remains that would cause an incorrect call.

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; the description goes slightly beyond by requiring doc_path to be exactly as returned in earlier results and by explaining the consequence of the scopes guard (the call is refused / forbidden outside scopes). It does not add format examples beyond the schema's own example path, so it stays just above baseline.

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 ("Return one knowledge document in full") and immediately enumerates what comes back: title, tags, complete source with front matter, content_hash, last-updated date, and inbound/outbound links. It also pins the lookup key ("by the doc_path given in search or bundle results"), which distinguishes it from search_context and list-type siblings without needing the schemas.

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?

Gives explicit selection criteria: "when a section is not enough, to follow a link, or before proposing an update." It names the downstream sibling (propose_update) and the exact handoff contract (pass the full result with base_content_hash = content_hash), so an agent knows both when to call this and what to do with the result.

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