base64_decode
Decode Base64 strings to plain text for data recovery or debugging purposes.
Instructions
Decode a Base64 string back to plain text.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | The Base64 string to decode |
Implementation Reference
- src/tools/encoding.ts:21-38 (handler)The implementation and registration of the 'base64_decode' tool.
server.tool( "base64_decode", "Decode a Base64 string back to plain text.", { input: z.string().describe("The Base64 string to decode") }, async ({ input }) => { try { const decoded = Buffer.from(input, "base64").toString("utf-8"); return { content: [{ type: "text" as const, text: decoded }] }; } catch { return { content: [ { type: "text" as const, text: "Error: Invalid Base64 input" }, ], isError: true, }; } } );