Skip to main content
Glama

read_source

Read-only

Read DOCX, XLSX, CSV, text, or HTML files under sources/ as citable units with anchors for citations; use paging and follow truncation cues for long sources.

Instructions

Read one raw vault source under sources/ (DOCX, XLSX, CSV, text, HTML) as citable units, each with the anchor for [[src:sources/<file>#<anchor>]]; repository code is read through analyze_repo_structure sourceReads. A PDF returns no text: read it natively and cite #p<n>. Follow next while truncated. side effect 0.

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": {
      "path": "<path>"
    },
    "name": "read_source"
  }
}

Input Schema

NameRequiredDescriptionDefault
fromNoFirst unit, 1-based.
pathYesPath under `sources/` (`sources/plan.docx`).
limitNoUnits to return at most. Default 200.
sheetNoXLSX: one sheet by number.

Output Schema

NameRequiredDescriptionDefault
fromYes
nextNo
noteNo
pathYes
unitsYes
formatYes
sha256Yes
truncatedYes
unitCountYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changedv2.7.5
    • changedInput schema / properties / from / description
      Previous value: -"1-based index of the first unit to return. Default 1."New value: +"First unit, 1-based."
    • changedInput schema / properties / path / description
      Previous value: -"Vault-relative path under `sources/` (`sources/plan.docx`)."New value: +"Path under `sources/` (`sources/plan.docx`)."
    • removedInput schema / properties / path / minLength
      Removed value: -1
    • removedInput schema / properties / path / pattern
      Removed value: -"^(?!\\s)(?!.*\\s$)(?!.*\\u0000).+$"
    • changedInput schema / properties / sheet / description
      Previous value: -"XLSX only: return one sheet, by its number in workbook order."New value: +"XLSX: one sheet by number."
    • removedOutput schema / properties / format / enum
      Removed value: -[
      -  "docx",
      -  "xlsx",
      -  "csv",
      -  "text",
      -  "html",
      -  "pdf",
      -  "binary"
      -]
    • removedOutput schema / properties / from / minimum
      Removed value: -1
    • removedOutput schema / properties / next / minimum
      Removed value: -1
    • removedOutput schema / properties / unitCount / minimum
      Removed value: -0
    • removedOutput schema / properties / units / items
      Removed value: -{
      -  "properties": {
      -    "anchor": {
      -      "type": "string"
      -    },
      -    "heading": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "kind": {
      -      "type": "string"
      -    },
      -    "sheet": {
      -      "type": "string"
      -    },
      -    "text": {
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "anchor",
      -    "text",
      -    "kind"
      -  ],
      -  "type": "object"
      -}
  2. First observedv0.13.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already cover safety (readOnlyHint=true, destructiveHint=false, openWorldHint=false), so the description's job is edge-case behavior, which it does: PDFs yield no text, results are unit-paginated with truncation/cursor semantics. "side effect 0" merely restates readOnlyHint and the annotation's idempotentHint=false is left unexplored, costing a point.

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 with the verb and resource, then edge cases, then pagination, in roughly four dense clauses with no filler. The backtick-heavy, semicolon-joined phrasing is terse to the point of being cryptic on first read, and "side effect 0" is a wasted tail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return-value explanation is optional; the description nonetheless conveys the citable-unit/anchor structure useful for citing. It covers the main hazards (format limits, truncation, repo-code handoff) for a 4-parameter read tool, with only the idempotency ambiguity left unaddressed.

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%, so `from`, `limit`, `path`, and `sheet` are already documented, and the description adds little per-parameter detail beyond the unit-based pagination framing. It does introduce the `next`/`truncated` continuation concept that appears nowhere in the input schema, which is real added meaning but limited in scope.

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 (read) and resource (one raw vault source under `sources/`), enumerates the supported formats (DOCX, XLSX, CSV, text, HTML), and describes the return shape (citable units with anchors). It also explicitly separates itself from `analyze_repo_structure` for repository code, so an agent can route without opening either schema.

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 when-not cases: repository code goes through `analyze_repo_structure` `sourceReads`, and PDFs return no text so they must be read natively and cited as `#p<n>`. It also gives the in-call continuation rule ("Follow `next` while `truncated`"), which tells the agent exactly what to do with a partial result.

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