Skip to main content
Glama

Read file

typst_read_file
Read-onlyIdempotent

Read project files to retrieve Typst text, inline images, or save binaries; use line ranges and optional line numbers for targeted review and comments.

Instructions

Read a file from a project. Text files (.typ, .bib, ...) return their content; images are returned inline; other binaries need save_to. Use start_line/end_line for long files. Use line_numbers=true when you plan comments on line ranges.

Input Schema

NameRequiredDescriptionDefault
pathYesProject-relative path like 'chapters/intro.typ', or a file ID
save_toNoLocal path to save the file to instead of returning it (needed for large binaries)
end_lineNoLast line to return (inclusive)
project_idYesProject ID from typst_list_projects, e.g. 'pAbC123dEf456gHi789jKl'
start_lineNoFirst line to return (1-based)
line_numbersNoPrefix each line with its number

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive behavior, so the safety profile is covered. The description adds genuine value beyond them by disclosing the polymorphic return behavior (text content, inline images, binaries requiring save_to), which the agent cannot infer from annotations. Missing operational details such as missing-file errors or size thresholds.

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?

Three tight sentences, each carrying distinct information, with the core read behavior front-loaded and parameter hints following. No repetition of the title or schema text and nothing extraneous.

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?

There is no output schema, and the description usefully compensates by explaining the shape of results per file type, which is what an agent most needs here. It is nearly complete, lacking only edge-case behavior (nonexistent path, very large text files) to be fully self-sufficient.

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 description coverage is 100%, so a baseline of 3 would be defensible, but the description adds intent beyond the schema text: line ranges are framed as the mechanism for long files, and line_numbers is tied to a specific downstream use (commenting on line ranges), which the schema's 'Prefix each line with its number' does not convey.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource (read a file from a project) and immediately explains the three return modes by file type, which is the key disambiguation an agent needs. It does not explicitly name typst_write_file/typst_edit_file as the mutating counterparts, so sibling differentiation is implicit rather than stated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete conditional guidance: start_line/end_line for long files, save_to for binaries, line_numbers when planning line-range comments. This is clear usage context for the non-obvious parameters, though it stops short of stating when to prefer a sibling tool (e.g., typst_download_project for bulk retrieval).

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