Skip to main content
Glama

upload_file

Write files to the Kali Linux container for security testing, enabling upload of wordlists, scripts, or configuration files to support penetration testing workflows.

Instructions

Upload/write a file to the Kali Linux container. Useful for uploading wordlists, scripts, or configuration files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path inside the container where the file should be written
contentYesFile content to write

Implementation Reference

  • The handler function for the 'upload_file' tool, which writes content to a specified path in the Docker container.
    async ({ path, content }) => {
      try {
        await docker.writeFile(path, content);
        return {
          content: [{ type: "text", text: `File written to ${path}` }],
        };
      } catch (err) {
        return {
          content: [
            {
              type: "text",
              text: `Failed to upload file: ${err instanceof Error ? err.message : String(err)}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Registration of the 'upload_file' tool with its schema definition and handler.
    server.tool(
      "upload_file",
      "Upload/write a file to the Kali Linux container. Useful for uploading wordlists, scripts, or configuration files.",
      {
        path: z.string().describe("Absolute path inside the container where the file should be written"),
        content: z.string().describe("File content to write"),
      },
      async ({ path, content }) => {
        try {
          await docker.writeFile(path, content);
          return {
            content: [{ type: "text", text: `File written to ${path}` }],
          };
        } catch (err) {
          return {
            content: [
              {
                type: "text",
                text: `Failed to upload file: ${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. It states this is a write operation ('upload/write'), implying mutation, but doesn't address critical aspects like permissions required, whether it overwrites existing files, error conditions, or rate limits. The mention of 'Kali Linux container' adds some context but lacks operational details.

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 appropriately concise with two sentences that directly address purpose and usage. The first sentence clearly states the action, and the second provides practical context without redundancy. It could be slightly more front-loaded by integrating the usage example earlier.

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?

Given a mutation tool with no annotations and no output schema, the description is minimally adequate. It covers the basic purpose and hints at usage but lacks details on behavioral traits, error handling, and output expectations. For a file upload operation, more context on permissions and file system interactions would improve completeness.

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 fully documents both parameters (path and content). The description adds no additional parameter semantics beyond what's in the schema, such as file format constraints or path examples. Baseline 3 is appropriate when the schema handles parameter documentation.

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 tool's purpose with specific verbs ('upload/write') and identifies the target resource ('file to the Kali Linux container'). It distinguishes from sibling tools like download_file and list_files by specifying a write operation. However, it doesn't explicitly differentiate from execute_command which might also involve file creation.

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 provides implied usage context with 'Useful for uploading wordlists, scripts, or configuration files,' suggesting appropriate scenarios. However, it lacks explicit guidance on when to use this versus alternatives like execute_command for creating files, and doesn't mention prerequisites or exclusions.

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