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
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The remote file URL to upload to rustypaste |
Implementation Reference
- src/tools/upload-remote.ts:41-64 (handler)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)}`, }, ], }; } } - src/tools/upload-remote.ts:5-10 (schema)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"), }); - src/tools/upload-remote.ts:14-66 (registration)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)}`, }, ], }; } } ); }