Skip to main content
Glama

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

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