Skip to main content
Glama

List directories

list_directories
Read-only

List and sort directories in a specified Linux path to organize and analyze file system contents for system administration tasks.

Instructions

List directories under a specified path with various sorting options.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to the directory to analyze
order_byNoSort order - 'size', 'name', or 'modified' (default: 'name')name
sortNoSort direction - 'ascending' or 'descending' (default: 'ascending')ascending
top_nNoOptional limit on number of directories to return (1-1000)
hostNoRemote host to connect to via SSH

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodesYes
totalNo
Behavior3/5

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

Annotations already declare readOnlyHint=true, so the agent knows this is a safe read operation. The description adds useful context about sorting options and path specification, but doesn't disclose behavioral traits like whether it lists only immediate subdirectories or recursively, what happens with invalid paths, or SSH connection behavior for the 'host' parameter. The description doesn't contradict 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 a single, efficient sentence that front-loads the core purpose. It wastes no words and is appropriately sized for a straightforward listing tool. However, it could be slightly more structured by explicitly mentioning the optional parameters beyond just 'sorting options'.

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?

Given the tool's moderate complexity (5 parameters, SSH capability), good annotations (readOnlyHint), and the presence of an output schema, the description is reasonably complete. It covers the core functionality but could better address the SSH 'host' parameter context and depth of listing. The output schema handles return values, so the description doesn't need to explain them.

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 all parameters are well-documented in the schema itself. The description mentions 'various sorting options' which aligns with 'order_by' and 'sort' parameters, but adds no additional semantic meaning beyond what the schema provides. With complete schema coverage, the baseline score of 3 is appropriate.

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?

The description clearly states the verb ('List') and resource ('directories under a specified path'), making the purpose unambiguous. It distinguishes from siblings like 'list_files' by specifying directories only, though it doesn't explicitly contrast with them. The description is specific but lacks explicit sibling differentiation.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'list_files' or other sibling tools. It mentions 'various sorting options' but doesn't explain when sorting is useful or when to choose this over simpler directory listing tools. No exclusions or prerequisites are stated.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rhel-lightspeed/linux-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server