Skip to main content
Glama

read_source

Read-only

Retrieve text from raw source files (DOCX, XLSX, CSV, HTML) as units with citation anchors for exact quoting and verification in wiki pages.

Instructions

Read the text of one raw source under sources/, cut into the units a wiki citation names (docs/ONTOLOGY-ATLAS-SPEC.md §11): a DOCX by heading (h:<slug>; paragraphs before the first heading are p1), an XLSX by sheet and row (s<n>r<m>), a CSV by row (r<n>), a text or HTML file by line (l<n>). Each unit carries the exact anchor to write into [[src:sources/<file>#<anchor>]], so a page cites what it quotes. A PDF returns no text: the agent runtime reads PDFs natively, page by page, and cites #p<n>. Nothing is converted and kept — the file is read on request and the text returned once. Paging: from (1-based unit index) and limit (default 200, max 1000); when truncated is true, next is the from to continue with. sheet narrows a workbook to one sheet number. Returns { path, format, unitCount, from, units: [{anchor, text, kind, heading?, sheet?}], truncated, next?, sha256, note? }. side effect 0. Use it in place of a shell command when a Compile, Check or ask turn needs what a DOCX or XLSX says.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fromNo1-based index of the first unit to return. Default 1.
pathYesVault-relative path under `sources/` (`sources/plan.docx`).
limitNoUnits to return at most. Default 200.
sheetNoXLSX only: return one sheet, by its number in workbook order.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
fromYes
nextNo
noteNo
pathYes
unitsYes
formatYes
sha256Yes
truncatedYes
unitCountYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.13.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=true and destructiveHint=false, and the description adds 'side effect 0' and 'Nothing is converted and kept — the file is read on request and the text returned once.' It thoroughly discloses paging behavior, including `truncated` and `next`, and the PDF no-text behavior, which goes beyond the structured annotations.

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 dense: it packs the unit grammar, special cases, paging, return shape, and usage guidance into a single cohesive block. It front-loads the core 'Read raw source into units' idea, though the later detailed listing of return fields could be trimmed since an output schema exists. No wasted words, but not extremely tight.

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 tool has a complex unit model and the description explains the return shape in enough detail, especially since an output schema already exists. It covers format-specific anchor syntax, the no-text PDF behavior, paging semantics, and the relationship to the `sources/` directory, leaving no ambiguity for an agent deciding to call it and process results correctly.

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?

The input schema already covers all 4 parameters, so the baseline is 3. The description adds meaning beyond the schema by explaining that `from`/`limit` are unit indices (not byte ranges), that `next` is a continuation pointer when `truncated` is true, and that `sheet` narrows a workbook. This connections between the parameters and the unit model is valuable.

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 states a clear action and target resource: 'Read the text of one raw source under `sources/`' and cuts it into citation units. It differentiates from any other read-style sibling by naming the exact formats and unit schemes (DOCX, XLSX, CSV, text/HTML) and by explaining what the PDF exception is. The 'Use it in place of a shell command' clause further separates it from non-shell, non-source tools.

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?

The description gives an explicit when-to-use: a Compile, Check or ask turn that needs DOCX or XLSX content, in place of a shell command. It also gives an explicit when-not-to-use: PDFs, which the agent runtime reads natively. No alternative tool is named, but the usage context and exclusions are unambiguous.

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