base64_encode
Encode strings to Base64 format for data transmission or storage. This tool converts text input into Base64 encoding, commonly used in web development and data handling.
Instructions
Encode a string to Base64.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | The string to encode |
Implementation Reference
- src/tools/encoding.ts:6-18 (handler)The handler and registration logic for base64_encode tool.
server.tool( "base64_encode", "Encode a string to Base64.", { input: z.string().describe("The string to encode") }, async ({ input }) => ({ content: [ { type: "text" as const, text: Buffer.from(input, "utf-8").toString("base64"), }, ], }) );