Skip to main content
Glama

Read a file in WSL

wsl_read_file
Read-onlyIdempotent

Read a text file in a WSL distro and return its contents; oversized files are truncated to leading bytes, making large logs safe to inspect.

Instructions

Read a text file in the distro and return its contents. Oversized files come back truncated to their leading bytes rather than failing, so pointing this at a large log is safe. Files that report size 0 but hold content (/proc, /sys) are read in full up to the ceiling.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute file path in the distro.
sessionNoSession id from wsl_connect. Optional — the file tools do not depend on a session's working directory, paths are absolute.
maxBytesNoLowers the read ceiling for this call; it cannot exceed WSL_MAX_READ_BYTES.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.2

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent and non-destructive, so the safety profile is covered. The description adds genuine behavioral context beyond that: oversized files truncate to leading bytes instead of failing, and zero-size-reporting files (/proc, /sys) are read in full up to the ceiling. It omits error behavior for missing or unreadable paths, keeping it from a 5.

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 sentences, each earning its place: purpose first, then the truncation safety guarantee, then the /proc and /sys edge case. No redundancy and the most decision-relevant information is front-loaded.

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 carries the return-value burden and does explain the shape of the response (contents, possibly truncated). Combined with annotations covering the safety profile, an agent has enough to call it correctly; only error handling and encoding details are missing.

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 schema already documents path, session and maxBytes. The description nonetheless adds meaning to maxBytes by framing it against the truncation "ceiling" and the oversized-file behavior, reinforcing how the parameter interacts with the read ceiling.

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 ("Read") and resource ("a text file in the distro") with the outcome ("return its contents"). This implicitly distinguishes it from wsl_write_file, wsl_list_dir, wsl_upload and wsl_exec, but no sibling is named explicitly, so it falls short of a 5.

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

Usage Guidelines3/5

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

Usage context is implied (safe for large logs, works on pseudo-files) but the description never states when to prefer this over alternatives like wsl_exec with a cat command or wsl_download for binary transfers. No exclusions or prerequisites are given, so guidance is only implied.

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