Skip to main content
Glama

rustypaste_upload_remote

Upload files from remote URLs to rustypaste for hosting. Fetch and mirror remote resources by providing a valid URL to create a rustypaste-hosted copy.

Instructions

Upload a file from a remote URL to rustypaste.

The rustypaste server fetches the file from the provided URL and hosts it. Useful for mirroring or re-hosting remote resources.

Args:

  • url (string): The remote file URL to fetch and upload (must be a valid URL)

Returns: The rustypaste URL for the uploaded file.

Examples:

  • Mirror an image: url="https://example.com/photo.jpg"

  • Re-host a file: url="https://cdn.example.com/release-v1.2.tar.gz"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe remote file URL to upload to rustypaste

Implementation Reference

  • The handler function for 'rustypaste_upload_remote' that calls the RustypasteClient to perform the upload.
    async (params: Input) => {
        try {
            const client = new RustypasteClient();
            const result = await client.uploadRemote(params.url);
            return {
                content: [
                    {
                        type: "text" as const,
                        text: `✅ Remote file uploaded!\n\nURL: ${result.url}\nSource: ${params.url}`,
                    },
                ],
            };
        } catch (error) {
            return {
                isError: true,
                content: [
                    {
                        type: "text" as const,
                        text: `Error: ${error instanceof Error ? error.message : String(error)}`,
                    },
                ],
            };
        }
    }
  • The Zod input schema for 'rustypaste_upload_remote'.
    const InputSchema = z.object({
        url: z
            .string()
            .url("Must be a valid URL")
            .describe("The remote file URL to upload to rustypaste"),
    });
  • The registration function 'registerUploadRemote' that defines the MCP tool 'rustypaste_upload_remote'.
    export function registerUploadRemote(server: McpServer): void {
        server.registerTool(
            "rustypaste_upload_remote",
            {
                title: "Upload from Remote URL",
                description: `Upload a file from a remote URL to rustypaste.
    
    The rustypaste server fetches the file from the provided URL and hosts it.
    Useful for mirroring or re-hosting remote resources.
    
    Args:
      - url (string): The remote file URL to fetch and upload (must be a valid URL)
    
    Returns:
      The rustypaste URL for the uploaded file.
    
    Examples:
      - Mirror an image: url="https://example.com/photo.jpg"
      - Re-host a file: url="https://cdn.example.com/release-v1.2.tar.gz"`,
                inputSchema: InputSchema,
                annotations: {
                    readOnlyHint: false,
                    destructiveHint: false,
                    idempotentHint: false,
                    openWorldHint: true,
                },
            },
            async (params: Input) => {
                try {
                    const client = new RustypasteClient();
                    const result = await client.uploadRemote(params.url);
                    return {
                        content: [
                            {
                                type: "text" as const,
                                text: `✅ Remote file uploaded!\n\nURL: ${result.url}\nSource: ${params.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