Skip to main content
Glama

rustypaste_paste_text

Upload text content to create shareable paste URLs for code snippets, notes, logs, or any text files. Specify content and optional filename to generate a URL.

Instructions

Upload text content to rustypaste and get a shareable URL.

Use this to paste code snippets, notes, logs, or any text content. The text is uploaded as a file and a URL is returned.

Args:

  • content (string): The text to paste (required, non-empty)

  • filename (string, optional): Name for the paste file (default: "paste.txt")

Returns: The URL of the created paste.

Examples:

  • Paste a log excerpt: content="error at line 42: null pointer"

  • Paste code with a name: content="def main(): ...", filename="app.py"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesThe text content to paste
filenameNoOptional filename for the paste (e.g. 'notes.md'). Defaults to 'paste.txt'

Implementation Reference

  • The handler function that executes the rustypaste_paste_text tool logic, utilizing RustypasteClient to upload the text.
    async (params: Input) => {
        try {
            const client = new RustypasteClient();
            const result = await client.pasteText(params.content, params.filename);
            return {
                content: [
                    {
                        type: "text" as const,
                        text: `✅ Paste created 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_paste_text tool.
    const InputSchema = z.object({
        content: z
            .string()
            .min(1, "Content must not be empty")
            .describe("The text content to paste"),
        filename: z
            .string()
            .optional()
            .describe(
                "Optional filename for the paste (e.g. 'notes.md'). Defaults to 'paste.txt'"
            ),
    });
    
    type Input = z.infer<typeof InputSchema>;
  • The registration logic for the rustypaste_paste_text tool on the MCP server.
        server.registerTool(
            "rustypaste_paste_text",
            {
                title: "Paste Text",
                description: `Upload text content to rustypaste and get a shareable URL.
    
    Use this to paste code snippets, notes, logs, or any text content.
    The text is uploaded as a file and a URL is returned.
    
    Args:
      - content (string): The text to paste (required, non-empty)
      - filename (string, optional): Name for the paste file (default: "paste.txt")
    
    Returns:
      The URL of the created paste.
    
    Examples:
      - Paste a log excerpt: content="error at line 42: null pointer"
      - Paste code with a name: content="def main(): ...", filename="app.py"`,
                inputSchema: InputSchema,
                annotations: {
                    readOnlyHint: false,
                    destructiveHint: false,
                    idempotentHint: false,
                    openWorldHint: true,
                },
            },
            async (params: Input) => {
                try {
                    const client = new RustypasteClient();
                    const result = await client.pasteText(params.content, params.filename);
                    return {
                        content: [
                            {
                                type: "text" as const,
                                text: `✅ Paste created 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