Skip to main content
Glama

Encode or decode Base64 text

convert_text
Read-onlyIdempotent

Encode pasted text to Base64 or decode Base64 and data URIs back to text. Use it for deterministic text conversion in a conversation, 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": "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 observedv1.0.1

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, non-destructive, and closed-world, so the safety profile is covered. The description still adds real value beyond that: it explains the tool is deterministic plain code rather than a model ('nothing is made up') and spells out the shape of both encoded and decoded results. It does not cover error/failure behavior, which keeps it just short of a 5.

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 operation, then usage constraints, then return shape — a sensible order. The return-value sentence is dense but earns its place since there is no output schema. Slightly long overall, but no sentence 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 carries the return-value burden and does so precisely, enumerating fields for both encoded and decoded results. Combined with the direction guidance and the file-vs-text boundary, an agent has everything needed to call it correctly.

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 would be 3. The description earns above that by tying data_uri to concrete output effects (adds 'dataUri' and 'mime') and by warning that 'auto' can misjudge short or unusual strings — a failure mode the schema's enum description does not mention.

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?

The first sentence names both directions of a specific operation on a specific resource: 'Encode pasted text to Base64, or decode Base64 (or a data URI) back to text.' It also distinguishes itself from the sibling by naming convert_file, so an agent can route between them 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?

Explicit when-to-use ('when you have text or a Base64 string in the conversation'), explicit when-not ('do not use it for a file on disk'), names the alternative (convert_file), and adds a conditional caveat about avoiding 'auto' on short or unusual strings. This is the full when/when-not/alternative triad.

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

Deploy Server

Other Tools