Skip to main content
Glama

List a directory in WSL

wsl_list_dir
Read-onlyIdempotent

List files in a WSL distro directory with type, permissions, size, and modification time. Returns structured output for read-only profiles, avoiding raw ls -la commands.

Instructions

List a directory in the distro, with type, permissions, size and mtime. Cheaper and more structured than running 'ls -la' through wsl_exec, and it works on a read-only profile.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute directory path in the distro. When WSL_ALLOWED_PATHS is set, only paths inside it are accepted.
sessionNoSession id from wsl_connect. Optional — the file tools do not depend on a session's working directory, paths are absolute.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.2

TDQS

A4.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so the safety profile is covered. The description adds one genuinely new behavioral fact – it functions on a read-only profile – but says nothing about restricted-path behavior, non-existent paths, or how errors surface, so it only modestly exceeds the annotation baseline.

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?

Two tight sentences: the first front-loads what the tool returns, the second justifies the tool against its alternative. No filler, no restatement of the name or title.

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?

For a simple read-only listing tool with full schema coverage and complete annotations, the description supplies the one thing missing (the shape of the returned entries) and names the alternative. No output schema exists, and the enumerated fields compensate adequately.

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 both the 'path' and 'session' parameters are already fully documented in the schema, including the WSL_ALLOWED_PATHS constraint. The description adds no parameter-level detail, which is the expected baseline when the schema does the work.

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 and resource ('List a directory in the distro') and enumerates the returned fields (type, permissions, size, mtime), so the agent knows exactly what it gets. It is clearly distinguishable from the other wsl_* siblings such as wsl_read_file or wsl_write_file.

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?

Explicitly routes the agent away from the obvious alternative by saying it is 'cheaper and more structured than running ls -la through wsl_exec', and gives a condition where it is the only option ('works on a read-only profile'). It does not, however, say when to prefer wsl_read_file or wsl_exec for other purposes.

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