Skip to main content
Glama

list_files

Read-only

List a directory's files, either its immediate children or all files beneath it recursively, to inspect APK decompile or decode output before reading individual files. Read-only.

Instructions

List a directory's immediate children, or every file beneath it with recursive - e.g. to see what decompile_apk or decode_apk produced before reading individual files. Only reads. Returns { dirPath, count, entries: [{ path, isDirectory, size }], truncated } where path is relative to dirPath and size is in bytes (0 for directories); truncated is true if the limit cut the listing short. Errors if dirPath doesn't exist. To find files by content rather than name use search_code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum entries to return. Default and maximum 500.
dirPathYesAbsolute path of the directory to list. Must exist.
recursiveNoList every entry under dirPath, not just its immediate children. Default false.
workspaceNoWorkspace name (not id). Created if it doesn't exist, and this call is recorded as a job in its history. Defaults to "default".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv1.3.7
    • changedInput schema / properties / dirPath / description
      Previous value: -"Absolute path to the directory to list"New value: +"Absolute path of the directory to list. Must exist."
    • addedInput schema / properties / limit / default
      Added value: +500
    • changedInput schema / properties / limit / description
      Previous value: -"Default/max 500 entries"New value: +"Maximum entries to return. Default and maximum 500."
    • addedInput schema / properties / limit / maximum
      Added value: +500
    • addedInput schema / properties / limit / minimum
      Added value: +1
    • addedInput schema / properties / recursive / default
      Added value: +false
    • changedInput schema / properties / recursive / description
      Previous value: -"List every file under dirPath, not just its immediate children. Default false."New value: +"List every entry under dirPath, not just its immediate children. Default false."
    • changedInput schema / properties / workspace / description
      Previous value: -"Workspace name (not id) - created automatically if it doesn't exist yet. Defaults to \"default\"."New value: +"Workspace name (not id). Created if it doesn't exist, and this call is recorded as a job in its history. Defaults to \"default\"."
  2. Changed2 schema fields changedv1.3.1
    • addedInput schema / properties / dirPath / description
      Added value: +"Absolute path to the directory to list"
    • addedInput schema / properties / recursive / description
      Added value: +"List every file under dirPath, not just its immediate children. Default false."
  3. First observedv1.3.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the description's 'Only reads' is reinforcing rather than novel. It does add genuinely useful behavior the annotations don't carry: truncation semantics when the limit is hit and error behavior when dirPath doesn't exist. Solid extra context, but no auth or rate-limit notes.

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?

Dense and front-loaded: the core action and the recursive variant come first, then the return shape, then the alternative. Every sentence carries information, though the inline return-shape listing makes the single paragraph heavier than necessary.

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?

No output schema exists, yet the description fully documents the return object (dirPath, count, entries with path/isDirectory/size, truncated), including relative-path and byte-unit conventions. Combined with the safety annotations, an agent has everything needed to call and interpret it.

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 limit, dirPath, recursive and workspace are all documented in structured data already. The description restates the meaning of recursive and the directory-existence requirement without adding syntax or format detail beyond the schema, so the baseline 3 holds.

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 (list) and resource (directory's children), and precisely scopes the recursive variant. It explicitly distinguishes itself from search_code (content vs name) and implies a relationship with read_file, so the agent can place it among siblings without opening a schema.

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

Usage Guidelines5/5

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

Gives concrete when-to-use context ('to see what decompile_apk or decode_apk produced before reading individual files') and names the alternative for a different task ('To find files by content rather than name use search_code'). Both the trigger and the exclusion are explicit.

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