rustypaste_oneshot_url
Create a one-time URL redirect that expires after a single visit to share sensitive links securely.
Instructions
Create a one-shot URL redirect — the link expires after a single visit.
Wraps a URL in a one-time redirect. After the first person clicks it, the redirect is deleted from the server.
Args:
url (string): The target URL to wrap (must be a valid URL)
Returns: The one-shot redirect URL.
Examples:
One-time link: url="https://example.com/sensitive-doc"
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The URL to create a one-shot redirect for |
Implementation Reference
- src/tools/oneshot-url.ts:40-63 (handler)The handler function that executes the rustypaste_oneshot_url tool.
async (params: Input) => { try { const client = new RustypasteClient(); const result = await client.oneshotUrl(params.url); return { content: [ { type: "text" as const, text: `✅ One-shot URL created!\n\n⚠️ This redirect will expire after a single visit.\n\nURL: ${result.url}`, }, ], }; } catch (error) { return { isError: true, content: [ { type: "text" as const, text: `Error: ${error instanceof Error ? error.message : String(error)}`, }, ], }; } } - src/tools/oneshot-url.ts:14-64 (registration)The registration of the rustypaste_oneshot_url tool.
export function registerOneshotUrl(server: McpServer): void { server.registerTool( "rustypaste_oneshot_url", { title: "One-Shot URL Redirect", description: `Create a one-shot URL redirect — the link expires after a single visit. Wraps a URL in a one-time redirect. After the first person clicks it, the redirect is deleted from the server. Args: - url (string): The target URL to wrap (must be a valid URL) Returns: The one-shot redirect URL. Examples: - One-time link: url="https://example.com/sensitive-doc"`, inputSchema: InputSchema, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true, }, }, async (params: Input) => { try { const client = new RustypasteClient(); const result = await client.oneshotUrl(params.url); return { content: [ { type: "text" as const, text: `✅ One-shot URL created!\n\n⚠️ This redirect will expire after a single visit.\n\nURL: ${result.url}`, }, ], }; } catch (error) { return { isError: true, content: [ { type: "text" as const, text: `Error: ${error instanceof Error ? error.message : String(error)}`, }, ], }; } } ); - src/tools/oneshot-url.ts:5-10 (schema)The input schema for the rustypaste_oneshot_url tool.
const InputSchema = z.object({ url: z .string() .url("Must be a valid URL") .describe("The URL to create a one-shot redirect for"), });