Skip to main content
Glama

base64_decode

Decode base64 encoded data to its original text format. Provide a base64 string to retrieve the plain text.

Instructions

decode base64 to text

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesbase64 text to decode

Implementation Reference

  • The handler function for the 'base64_decode' tool. It receives the 'content' parameter (base64-encoded text), calls Base64Util.decode() to decode it, and returns the decoded text.
    async ({ content }) => {
        const result = Base64Util.decode(content);
        return {
            content: [
                {
                    type: "text",
                    text: result,
                },
            ],
        };
    }
  • The input schema for 'base64_decode': a required 'content' field of type string, describing the base64 text to decode.
    {
        content: z.string().describe("base64 text to decode"),
  • The registration of the 'base64_decode' tool via server.tool() with name 'base64_decode', description 'decode base64 to text', and the async handler that decodes input.
    // Base64 Decode
    server.tool(
        "base64_decode",
        "decode base64 to text",
        {
            content: z.string().describe("base64 text to decode"),
        },
        async ({ content }) => {
            const result = Base64Util.decode(content);
            return {
                content: [
                    {
                        type: "text",
                        text: result,
                    },
                ],
            };
        }
    );
  • The Base64Util.decode() helper method that performs the actual base64 decoding using Buffer.from(input, 'base64').toString('utf-8').
    static decode(input: string): string {
        return Buffer.from(input, 'base64').toString('utf-8');
    }
  • src/index.ts:6-19 (registration)
    Import of registerBase64Tool from './service/base64.js' into the main entry point.
    import { registerBase64Tool } from "./service/base64.js";
    import { registerHexTool } from "./service/hex.js";
    // Create an MCP server
    const server = new McpServer({
      name: "crypto-mcp",
      version: "1.0.0",
    });
    
    // Register tools
    registerAESTool(server);
    registerDigestTool(server);
    registerDESTool(server);
    registerBase64Tool(server);
    registerHexTool(server);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It fails to disclose error handling (e.g., invalid base64 input) or output format (e.g., UTF-8 text). The tool is simple, but more transparency is expected.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with no extraneous words. It fits in a single line, which is efficient. However, it could be slightly expanded to improve clarity without becoming verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one parameter, no output schema), the description is minimally adequate. It doesn't explain the output encoding or error cases, but these are common knowledge for a base64 decode operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% (parameter 'content' described as 'base64 text to decode'). The tool description adds minimal extra meaning beyond restating what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description ('decode base64 to text') clearly states the verb and resource, distinguishing it from the sibling tool base64_encode. However, it could be more specific by noting the output format.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus siblings or alternatives, such as when to use base64_decode vs base64_encode or other decoders.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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