Skip to main content
Glama

One-Shot File Upload

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)}`,
                            },
                        ],
                    };
                }
            }
        );
Behavior5/5

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

The description adds significant behavioral context beyond annotations: it explains the 'one-shot' mechanism ('it can only be viewed/downloaded once'), automatic deletion after first access, and security implications. Annotations provide basic hints (e.g., readOnlyHint=false, destructiveHint=false), but the description elaborates on the tool's unique ephemeral behavior, which is crucial for understanding its use case.

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 well-structured and front-loaded: the first sentence defines the core functionality, followed by key behavioral details, usage context, and structured examples. Every sentence adds value without redundancy, making it efficient and easy to parse.

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?

Given the tool's complexity (ephemeral file upload) and lack of output schema, the description provides complete context: it explains the one-shot mechanism, deletion behavior, security use case, parameter usage with examples, and return value ('The one-shot URL'). This compensates for missing structured output details and aligns well with the annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds practical meaning beyond the schema: it clarifies the parameter's purpose ('Absolute path to the file') and provides concrete examples (e.g., '/home/user/secret.txt', '/tmp/credentials.txt'). With 100% schema description coverage, the baseline is 3, but the examples and context elevate the score by making the parameter usage more intuitive.

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?

The description clearly states the specific action ('Upload a file as a one-shot link') and resource ('file'), distinguishing it from siblings like 'rustypaste_upload_file' (standard upload) and 'rustypaste_upload_file_with_expiry' (time-based expiry). The 'one-shot' mechanism is explicitly defined, making the purpose unambiguous.

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?

The description explicitly states when to use this tool ('Useful for sharing sensitive or temporary files securely') and implies alternatives through sibling tool names (e.g., 'rustypaste_upload_file_with_expiry' for time-based deletion). The 'one-shot' behavior clearly differentiates it from other upload options, providing strong contextual guidance.

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

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