Skip to main content
Glama

Encode or decode Base64 text

base64_convert_text
Read-onlyIdempotent

Encode text to Base64 or decode Base64 and data URIs back to UTF-8 text. Use it for deterministic text conversions in chat, not for files on disk.

Instructions

Encode pasted text to Base64, or decode Base64 (or a data URI) back to text.

Use this when you have text or a Base64 string in the conversation. It is plain code, not an AI model, so the same input always gives the same output and nothing is made up. Do not use it for a file on disk (use convert_file for files), and do not use auto on short or unusual strings if you already know the direction — pass encode or decode instead.

Returns a result object. Encoded results include "action", "base64", "bytesIn", and "dataUri" plus "mime" when data_uri is true. Decoded results include "action", "bytesOut", "isText", and "text" (UTF-8 text, or null if the bytes are not text).

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>"
    },
    "name": "base64_convert_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesThe text to encode, or the Base64 (or data URI) to decode.
actionNoWhat to do. "auto" (default) decodes if the input looks like Base64, otherwise it encodes. Use "encode" or "decode" when you already know the direction.auto
data_uriNoIf true, encoded results also include a data: URI.
url_safeNoIf true, encode with - and _ instead of + and /. Decoding always accepts both.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so safety is covered structurally. The description adds determinism ('plain code, not an AI model, so the same input always gives the same output'), notes that decoding always accepts both alphabets, and warns that decoded text may be null when bytes aren't text — real behavior beyond the annotations. It stops short of describing failure modes for invalid Base64 input.

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?

Front-loaded with the core action, then scope, then exclusions, then return shape — a sensible ordering. The 'plain code, not an AI model' sentence is slightly promotional but carries useful determinism information; the return-field enumeration is justified because there is no output schema.

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

Completeness4/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 correctly compensates by enumerating the encoded and decoded result fields, including the nullable text case, so an agent knows what to expect back. The only real omission is error behavior on malformed Base64 decode input.

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% and each of the four parameters is already documented in the schema, including enum meaning and defaults. The description adds essentially one nuance beyond the schema (data-URI input accepted, url_safe acceptance on decode), so it sits at the baseline rather than adding real semantic depth.

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

Purpose5/5

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

States a specific verb pair (encode/decode) plus resource (Base64 text), and explicitly bounds scope to text pasted in the conversation, contrasting with the file sibling convert_file. An agent can distinguish it from base64_convert_file without opening either schema.

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

Usage Guidelines5/5

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

Gives explicit when-to-use (text or Base64 string already in the conversation), an explicit when-not (a file on disk -> use convert_file), and a concrete routing rule for the action parameter (pass encode/decode rather than auto for short or unusual strings). Alternatives and conditions are both named.

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