Skip to main content
Glama

base64_decode

Decode base64-encoded text to its original readable format. Use this tool to convert encoded strings back to plain text for processing or analysis.

Instructions

decode base64 to text

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesbase64 text to decode

Implementation Reference

  • The handler function that executes the base64_decode tool logic by calling Base64Util.decode on the input and returning the result as text content.
    async ({ content }) => {
        const result = Base64Util.decode(content);
        return {
            content: [
                {
                    type: "text",
                    text: result,
                },
            ],
        };
    }
  • Input schema definition for the base64_decode tool using Zod.
    {
        content: z.string().describe("base64 text to decode"),
    },
  • Registration of the base64_decode tool on the MCP server, including name, description, schema, and handler.
    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,
                    },
                ],
            };
        }
    );
  • Helper utility function in Base64Util class that performs the core base64 decoding using Node.js Buffer.
    static decode(input: string): string {
        return Buffer.from(input, 'base64').toString('utf-8');
    }
  • src/index.ts:18-18 (registration)
    Invocation of the registerBase64Tool function to register base64 tools, including base64_decode, on the main MCP server.
    registerBase64Tool(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 for behavioral disclosure. 'decode base64 to text' implies a transformation operation but doesn't specify error handling (e.g., for invalid base64 input), performance characteristics, or what happens with non-text binary data. This leaves significant behavioral gaps.

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

Conciseness5/5

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

The description 'decode base64 to text' is extremely concise—just three words—and front-loaded with the essential action. Every word earns its place, making it efficient and immediately understandable without any wasted verbiage.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete for a decoding tool. It doesn't explain what happens with invalid input, whether it handles binary vs. text output, or what the return format looks like. For a transformation operation, this leaves too many contextual questions unanswered.

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?

The input schema has 100% description coverage, with the 'content' parameter clearly documented as 'base64 text to decode'. The description adds no additional parameter information beyond what the schema provides, which is adequate given the comprehensive schema coverage.

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 action (decode) and the resource (base64 to text), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'hex_decode' or 'base64_encode', which would require mentioning the specific encoding format being decoded.

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 alternatives. With siblings like 'hex_decode', 'aes_decrypt', and 'base64_encode', there's no indication of when base64 decoding is appropriate versus other decoding methods or encoding operations.

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