Skip to main content
Glama

base64_encode

Encode text into base64 format securely and efficiently using Crypto_MCP. Ideal for data handling and secure transmission in encryption workflows.

Instructions

encode text to base64

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYestext to encode

Implementation Reference

  • Handler function for the base64_encode tool. It takes the input 'content', encodes it using Base64Util.encode, and returns the result as text content.
    async ({ content }) => { const result = Base64Util.encode(content); return { content: [ { type: "text", text: result, }, ], }; }
  • Input schema for the base64_encode tool, specifying 'content' as a string to encode.
    { content: z.string().describe("text to encode"), },
  • Registration of the base64_encode tool on the MCP server, including name, description, input schema, and handler function.
    server.tool( "base64_encode", "encode text to base64", { content: z.string().describe("text to encode"), }, async ({ content }) => { const result = Base64Util.encode(content); return { content: [ { type: "text", text: result, }, ], }; } );
  • Helper method Base64Util.encode that implements the core base64 encoding logic using Node.js Buffer.
    static encode(input: string): string { return Buffer.from(input).toString('base64'); }
  • src/index.ts:18-18 (registration)
    Call to registerBase64Tool in the main server initialization, which registers the base64_encode tool among others.
    registerBase64Tool(server);

Other Tools

Related Tools

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/1595901624/crypto-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server