Skip to main content
Glama

list_files

Browse directory contents in a Kali Linux container to view files and folders for security testing workflows.

Instructions

List files in a directory inside the Kali Linux container.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoDirectory path inside the container (default: /workspace)

Implementation Reference

  • MCP tool handler implementation for "list_files" in filesystem.ts. It calls the docker-manager's listFiles method.
    async ({ path }) => {
      try {
        const listing = await docker.listFiles(path ?? "/workspace");
        return {
          content: [{ type: "text", text: listing }],
        };
      } catch (err) {
        return {
          content: [
            {
              type: "text",
              text: `Failed to list files: ${err instanceof Error ? err.message : String(err)}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Backend implementation of listFiles in DockerManager, which executes the "ls -la" command inside the container.
    async listFiles(containerPath: string = "/workspace"): Promise<string> {
      const result = await this.executeCommand(`ls -la ${containerPath}`);
      if (result.exitCode !== 0) {
        throw new Error(`Failed to list files: ${result.stderr}`);
      }
      return result.stdout;
    }
  • Tool registration block for "list_files" within the registerFilesystemTools function.
      server.tool(
        "list_files",
        "List files in a directory inside the Kali Linux container.",
        {
          path: z
            .string()
            .optional()
            .describe("Directory path inside the container (default: /workspace)"),
        },
        async ({ path }) => {
          try {
            const listing = await docker.listFiles(path ?? "/workspace");
            return {
              content: [{ type: "text", text: listing }],
            };
          } catch (err) {
            return {
              content: [
                {
                  type: "text",
                  text: `Failed to list files: ${err instanceof Error ? err.message : String(err)}`,
                },
              ],
              isError: true,
            };
          }
        }
      );
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'List' implies a read-only operation, it doesn't specify permissions needed, output format, error conditions, or whether it shows hidden files. The description adds minimal behavioral context beyond the basic action.

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?

The description is a single, efficient sentence with zero waste. It's appropriately sized for a simple listing tool and front-loads the essential information (action, resource, context).

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?

For a simple listing tool with one parameter and no output schema, the description provides adequate but minimal context. It specifies the container environment but lacks details about return format, error handling, or integration with sibling tools. The description is complete enough for basic understanding but leaves gaps for practical implementation.

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% with the single parameter well-documented in the schema. The description adds no additional parameter semantics beyond what the schema provides about the path parameter. Baseline 3 is appropriate when schema does the heavy lifting.

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 ('files in a directory'), specifying the context ('inside the Kali Linux container'). It distinguishes from siblings like download_file and upload_file by focusing on listing rather than file transfer. However, it doesn't explicitly differentiate from execute_command or container_status operations.

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 minimal guidance by specifying the container context, but offers no explicit when-to-use rules, prerequisites, or alternatives. It doesn't indicate when to use this versus other file-related tools or how it complements container management siblings like container_status.

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/Hannes221/kali-mcp'

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