Skip to main content
Glama

List directories

list_directories
Read-only

List directories under a specified absolute path, with options to sort by name, size, or modified time and limit results for quick filesystem analysis.

Instructions

List directories under a specified path with various sorting options.

Input Schema

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodesYes
totalNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed13 schema fields changedv1.6.0
    • removedInput schema / $defs
      Removed value: -{
      -  "OrderBy": {
      -    "enum": [
      -      "size",
      -      "name",
      -      "modified"
      -    ],
      -    "type": "string"
      -  },
      -  "SortBy": {
      -    "enum": [
      -      "ascending",
      -      "descending"
      -    ],
      -    "type": "string"
      -  }
      -}
    • addedInput schema / additionalProperties
      Added value: +false
    • removedInput schema / properties / order_by / $ref
      Removed value: -"#/$defs/OrderBy"
    • addedInput schema / properties / order_by / enum
      Added value: +[
      +  "size",
      +  "name",
      +  "modified"
      +]
    • addedInput schema / properties / order_by / type
      Added value: +"string"
    • removedInput schema / properties / sort / $ref
      Removed value: -"#/$defs/SortBy"
    • addedInput schema / properties / sort / enum
      Added value: +[
      +  "ascending",
      +  "descending"
      +]
    • addedInput schema / properties / sort / type
      Added value: +"string"
    • removedOutput schema / $defs
      Removed value: -{
      -  "NodeEntry": {
      -    "description": "A node entry model that is used by both directories and files listing.",
      -    "properties": {
      -      "human_modified": {
      -        "default": "1970-01-01T00:00:00",
      -        "format": "date-time",
      -        "type": "string"
      -      },
      -      "human_size": {
      -        "default": "",
      -        "type": "string"
      -      },
      -      "modified": {
      -        "default": 0,
      -        "type": "number"
      -      },
      -      "name": {
      -        "default": "",
      -        "type": "string"
      -      },
      -      "size": {
      -        "default": 0,
      -        "type": "integer"
      -      }
      -    },
      -    "type": "object"
      -  }
      -}
    • removedOutput schema / properties / nodes / items / $ref
      Removed value: -"#/$defs/NodeEntry"
    • addedOutput schema / properties / nodes / items / description
      Added value: +"A node entry model that is used by both directories and files listing."
    • addedOutput schema / properties / nodes / items / properties
      Added value: +{
      +  "human_modified": {
      +    "default": "1970-01-01T00:00:00",
      +    "format": "date-time",
      +    "type": "string"
      +  },
      +  "human_size": {
      +    "default": "",
      +    "type": "string"
      +  },
      +  "modified": {
      +    "default": 0,
      +    "type": "number"
      +  },
      +  "name": {
      +    "default": "",
      +    "type": "string"
      +  },
      +  "size": {
      +    "default": 0,
      +    "type": "integer"
      +  }
      +}
    • addedOutput schema / properties / nodes / items / type
      Added value: +"object"
  2. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

The readOnlyHint annotation already covers safety, and the description consistently says 'List', which matches that annotation. It adds minor context about sorting options but does not disclose behavior such as remote host handling or output truncation beyond what annotations provide.

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?

A single, front-loaded sentence states the core action and resource, then appends the sorting capability. There is no redundant or filler content.

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?

Given the readOnlyHint annotation, a fully documented 100% input schema, and an output schema, the description is sufficiently complete for correct invocation. Nothing critical is missing.

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 the schema already documents every parameter. The description adds no parameter-specific meaning beyond mentioning 'sorting options,' which is already detailed in the sort and order_by parameter 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?

The description uses a specific verb ('List') and resource ('directories under a specified path'), clearly distinguishing it from sibling tools like list_files. It also mentions sorting options, which adds functional scope.

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?

The description implies the tool is for enumerating directories at a given path, but it does not explicitly state when to use this tool versus siblings like list_files or read_file. No exclusionary or alternative guidance is provided.

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