Skip to main content
Glama

Base64 encode or decode

base64
Read-only

Encode text (as UTF-8) to Base64, or decode Base64 back to text, and return the result. Decoding accepts standard and URL-safe alphabets and ignores whitespace; invalid Base64 returns an error. Bytes that are not valid UTF-8 are shown as replacement characters. Input up to 100 KB.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "text": "<text>",
      "mode": "<mode>"
    },
    "name": "base64"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeYesencode: text to Base64; decode: Base64 to text
textYesText to encode, or Base64 to decode
urlSafeNoWhen encoding, use - and _ and drop = padding (for URLs and JWTs)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / mode / description
      Added value: +"encode: text to Base64; decode: Base64 to text"
    • addedInput schema / properties / text / description
      Added value: +"Text to encode, or Base64 to decode"
    • addedInput schema / properties / urlSafe / description
      Added value: +"When encoding, use - and _ and drop = padding (for URLs and JWTs)"
  2. First observed

TDQS

A4.2/5.0
Behavior5/5

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

Annotations already establish readOnly, non-destructive, closed-world behavior, and the description goes well beyond them: error on invalid Base64, replacement characters for non-UTF-8 bytes, whitespace tolerance on decode, and a 100 KB input cap. These are exactly the failure modes an agent needs before calling.

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?

Three compact sentences, front-loaded with the core operation, then decode quirks, then the size limit. Every clause carries operational information; nothing is filler.

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

Completeness5/5

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

With no output schema, the description still tells the agent what comes back (the result string) and how failures surface (errors for invalid Base64, replacement characters for bad UTF-8). Combined with a fully documented three-parameter schema, nothing material is missing for correct invocation.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds meaning the schema lacks — the encode input is treated as UTF-8 and the 100 KB ceiling applies to the text field. It also clarifies that urlSafe affects encoding only and is irrelevant on decode, which the schema description does not state.

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 opens with specific verbs and a clear resource pair: 'Encode text (as UTF-8) to Base64, or decode Base64 back to text.' The reversibility is explicit, which implicitly separates it from one-way siblings like hash_text or format_json, but no sibling is named or contrasted, so it sits at clear-but-undifferentiated.

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

Usage Guidelines3/5

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

Usage is implied through the mode semantics ('encode' produces Base64, 'decode' consumes it) and the note that decoding accepts standard plus URL-safe alphabets and ignores whitespace. There is no explicit guidance on when to pick this over hash_text or other conversion siblings, and no note on which mode pairs with urlSafe output.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.