Skip to main content
Glama

rustypaste_oneshot_file

Upload files to generate single-use links that delete automatically after first access, suitable for sharing sensitive or temporary content securely.

Instructions

Upload a file as a one-shot link — it can only be viewed/downloaded once.

After the first access, the file is automatically deleted from the server. Useful for sharing sensitive or temporary files securely.

Args:

  • file_path (string): Absolute path to the file (e.g. "/home/user/secret.txt")

Returns: The one-shot URL. The file will be deleted after the first download.

Examples:

  • Share a secret: file_path="/tmp/credentials.txt"

  • One-time image share: file_path="/home/user/photo.jpg"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path to the file to upload as a one-shot

Implementation Reference

  • The handler function that executes the rustypaste_oneshot_file tool logic.
    async (params: Input) => {
        try {
            const client = new RustypasteClient();
            const result = await client.oneshotFile(params.file_path);
            return {
                content: [
                    {
                        type: "text" as const,
                        text: `✅ One-shot file uploaded!\n\n⚠️ This link will expire after a single view.\n\nURL: ${result.url}`,
                    },
                ],
            };
        } catch (error) {
            return {
                isError: true,
                content: [
                    {
                        type: "text" as const,
                        text: `Error: ${error instanceof Error ? error.message : String(error)}`,
                    },
                ],
            };
        }
    }
  • The input schema definition for the rustypaste_oneshot_file tool.
    const InputSchema = z.object({
        file_path: z
            .string()
            .min(1, "File path must not be empty")
            .describe("Absolute path to the file to upload as a one-shot"),
    });
  • The registration function that registers the rustypaste_oneshot_file tool with the MCP server.
    export function registerOneshotFile(server: McpServer): void {
        server.registerTool(
            "rustypaste_oneshot_file",
            {
                title: "One-Shot File Upload",
                description: `Upload a file as a one-shot link — it can only be viewed/downloaded once.
    
    After the first access, the file is automatically deleted from the server.
    Useful for sharing sensitive or temporary files securely.
    
    Args:
      - file_path (string): Absolute path to the file (e.g. "/home/user/secret.txt")
    
    Returns:
      The one-shot URL. The file will be deleted after the first download.
    
    Examples:
      - Share a secret: file_path="/tmp/credentials.txt"
      - One-time image share: file_path="/home/user/photo.jpg"`,
                inputSchema: InputSchema,
                annotations: {
                    readOnlyHint: false,
                    destructiveHint: false,
                    idempotentHint: false,
                    openWorldHint: true,
                },
            },
            async (params: Input) => {
                try {
                    const client = new RustypasteClient();
                    const result = await client.oneshotFile(params.file_path);
                    return {
                        content: [
                            {
                                type: "text" as const,
                                text: `✅ One-shot file uploaded!\n\n⚠️ This link will expire after a single view.\n\nURL: ${result.url}`,
                            },
                        ],
                    };
                } catch (error) {
                    return {
                        isError: true,
                        content: [
                            {
                                type: "text" as const,
                                text: `Error: ${error instanceof Error ? error.message : String(error)}`,
                            },
                        ],
                    };
                }
            }
        );

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/rukh-debug/rustypaste-mcp'

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