Skip to main content
Glama

Read a File from Litewrite

litewrite_read_file
Read-onlyIdempotent

Read the content of a file directly from the Litewrite server, preferring the server copy over the local mirror. Supports optional line ranges for reading specific sections.

Instructions

Read the content of a file directly from the Litewrite server (POST /api/internal/files/read).

Prefers the server copy over the local mirror; use litewrite_local_read to read the local working copy instead.

Args:

  • projectId (string, required): The project id.

  • filePath (string, required): Path relative to the project root, e.g. "main.tex" or "chapters/intro.tex".

  • startLine / endLine (number, optional): Read only a line range.

Returns the file content as UTF-8 text.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endLineNoLast line to read
filePathYesPath relative to the project root
projectIdYesThe Litewrite project id
startLineNoFirst line to read

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, so the safety profile is covered. The description adds genuine value beyond them: the underlying endpoint, the server-vs-local-mirror preference, and the UTF-8 return format.

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 purpose and the sibling disambiguation, then a compact Args block. The Args list mildly duplicates the schema, so it is not maximally tight, but nothing is wasted.

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?

With no output schema, the description supplies the return format (UTF-8 text) and the source-of-truth behavior. Edge cases like out-of-range line values are not addressed, but everything needed to call the tool correctly is present.

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, but the description adds concrete path examples ('main.tex', 'chapters/intro.tex') and clarifies that startLine/endLine read a line range, which is marginally more than the schema's terse field descriptions.

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+resource ('Read the content of a file') and explicitly distinguishes itself from the sibling local reader, naming litewrite_local_read and the condition that selects it.

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-to-use routing: prefer the server copy, and use litewrite_local_read to read the local working copy instead. The alternative and its selection condition are stated, not implied.

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