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,
          };
        }
      }
    );

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