Skip to main content
Glama

List files

list_files
Read-only

List files under a specified path on local or remote Linux hosts, sorted by name, size, or modification time to aid troubleshooting.

Instructions

List files under a specified path with various sorting options.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostYesSystem to run on: 'localhost' for the system the MCP server runs on, or a remote 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 files to return (1-1000, only used with size ordering)
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. Changed16 schema fields changedv1.7.0
    • removedInput schema / properties / host / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / host / default
      Removed value: -null
    • changedInput schema / properties / host / description
      Previous value: -"Remote host to connect to via SSH"New value: +"System to run on: 'localhost' for the system the MCP server runs on, or a remote host to connect to via SSH"
    • addedInput schema / properties / host / examples
      Added value: +[
      +  "localhost",
      +  "web1.example.com"
      +]
    • addedInput schema / properties / host / type
      Added value: +"string"
    • changedInput schema / required
      Previous value: -[
      -  "path"
      -]New value: +[
      +  "path",
      +  "host"
      +]
    • removedOutput schema / properties / nodes / items / properties / human_modified
      Removed value: -{
      -  "default": "1970-01-01T00:00:00",
      -  "format": "date-time",
      -  "type": "string"
      -}
    • removedOutput schema / properties / nodes / items / properties / human_size
      Removed value: -{
      -  "default": "",
      -  "type": "string"
      -}
    • removedOutput schema / properties / nodes / items / properties / modified / default
      Removed value: -0
    • addedOutput schema / properties / nodes / items / properties / modified / description
      Added value: +"Modification time"
    • addedOutput schema / properties / nodes / items / properties / modified / format
      Added value: +"date-time"
    • changedOutput schema / properties / nodes / items / properties / modified / type
      Previous value: -"number"New value: +"string"
    • addedOutput schema / properties / nodes / items / properties / size / anyOf
      Added value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedOutput schema / properties / nodes / items / properties / size / default
      Previous value: -0New value: +null
    • addedOutput schema / properties / nodes / items / properties / size / description
      Added value: +"Size in bytes, included only when ordering by size"
    • removedOutput schema / properties / nodes / items / properties / size / type
      Removed value: -"integer"
  2. 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"
  3. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

Annotations already declare readOnlyHint=true, so the safety profile is covered. The description adds only 'with various sorting options', which merely restates schema content; it says nothing about SSH remote-host behavior, result limits, permission failures, or pagination.

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?

A single front-loaded sentence that names the verb and resource immediately. The trailing clause 'with various sorting options' is mildly redundant filler but costs little.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists so return values need not be described, and annotations plus 100% schema coverage carry most of the burden. However, for a tool requiring a host/SSH target and offering sort/limit behavior, the description leaves the agent without any routing or scoping context.

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 five parameters (including host, sort, order_by, top_n) are already documented with examples and defaults. The description's mention of sorting options adds no syntax or constraint detail beyond the schema, so the baseline 3 applies.

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?

Clear verb+resource: 'List files under a specified path'. The word 'files' implicitly separates it from the sibling list_directories, though the description never names that sibling explicitly, so the differentiation is inferred rather than stated.

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?

No when-to-use guidance, no prerequisites, and no mention of alternatives such as list_directories or read_file. The only usage hint is the existence of sorting options, which is a capability statement rather than guidance.

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