Skip to main content
Glama

Upload File

rustypaste_upload_file

Upload local files to rustypaste for sharing via URL. Specify file path to generate shareable download links.

Instructions

Upload a local file to rustypaste and get a shareable URL.

Reads a file from disk and uploads it to the rustypaste server. Supports any file type. The returned URL can be shared to download the file.

Args:

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

Returns: The URL of the uploaded file.

Examples:

  • Upload an image: file_path="/home/user/screenshot.png"

  • Upload a document: file_path="/tmp/report.pdf"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path to the file to upload

Implementation Reference

  • The handler function that executes the file upload using RustypasteClient.
    async (params: Input) => {
        try {
            const client = new RustypasteClient();
            const result = await client.uploadFile(params.file_path);
            return {
                content: [
                    {
                        type: "text" as const,
                        text: `✅ File uploaded successfully!\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_upload_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"),
    });
  • The registration function that defines the tool in the MCP server.
    export function registerUploadFile(server: McpServer): void {
        server.registerTool(
            "rustypaste_upload_file",
            {
                title: "Upload File",
                description: `Upload a local file to rustypaste and get a shareable URL.
    
    Reads a file from disk and uploads it to the rustypaste server.
    Supports any file type. The returned URL can be shared to download the file.
    
    Args:
      - file_path (string): Absolute path to the file (e.g. "/home/user/doc.pdf")
    
    Returns:
      The URL of the uploaded file.
    
    Examples:
      - Upload an image: file_path="/home/user/screenshot.png"
      - Upload a document: file_path="/tmp/report.pdf"`,
                inputSchema: InputSchema,
                annotations: {
                    readOnlyHint: false,
                    destructiveHint: false,
                    idempotentHint: false,
                    openWorldHint: true,
                },
            },
            async (params: Input) => {
                try {
                    const client = new RustypasteClient();
                    const result = await client.uploadFile(params.file_path);
                    return {
                        content: [
                            {
                                type: "text" as const,
                                text: `✅ File uploaded successfully!\n\nURL: ${result.url}`,
                            },
                        ],
                    };
                } catch (error) {
                    return {
                        isError: true,
                        content: [
                            {
                                type: "text" as const,
                                text: `Error: ${error instanceof Error ? error.message : String(error)}`,
                            },
                        ],
                    };
                }
            }
        );
    }
Behavior4/5

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

Annotations cover read/write status and idempotency, but the description adds valuable context: it discloses that the tool reads from disk (local file access) and returns a shareable URL. It doesn't contradict annotations, and provides useful behavioral details beyond the structured hints.

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 with the core purpose. Each sentence adds value: explaining the action, file support, and return value. The examples are relevant and concise, with no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter tool with good annotations and no output schema, the description is reasonably complete. It explains what the tool does, the parameter usage, and the return value. However, it could better differentiate from sibling tools to enhance contextual understanding.

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 already documents the single parameter fully. The description adds minimal value with an example ('e.g., "/home/user/doc.pdf"'), but doesn't provide additional semantics beyond what's in the schema. Baseline 3 is appropriate given high schema coverage.

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 local file to rustypaste') and resource ('file'), distinguishing it from siblings like text pasting or URL shortening. It specifies reading from disk and uploading to server, 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 Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by mentioning 'local file' and 'any file type,' but doesn't explicitly state when to use this tool versus alternatives like rustypaste_upload_file_with_expiry or rustypaste_upload_remote. No explicit exclusions or named alternatives are provided.

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