Skip to main content
Glama

Base64 encode and decode

util_base64

Use when an agent must put bytes through a header, a URL or a JSON field, or read what came back: base64 in both directions, including the URL-safe alphabet, with UTF-8 handled properly. x402 itself rides on base64, so this is the one that reads a payment header. Do not use for hashing (/v1/util/sha256) or for hex (/v1/util/hex). No API key, no account. $0.005 per call, paid over x402 (USDC).

Input Schema

NameRequiredDescriptionDefault
modeNoencode | decode. Defaults to encode.
inputYesThe text or base64 to convert.
urlSafeNoUse the URL-safe alphabet (-_ instead of +/).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and usefully discloses that no API key or account is required and that calls cost $0.005 via x402/USDC. It also clarifies UTF-8 handling and URL-safe alphabet support, though it does not describe error behavior for invalid base64 or the exact return shape.

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 is front-loaded with the usage condition and operation, then moves to exclusions, then to payment and access details. Every sentence contributes relevant routing or operational context, with no filler.

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?

For a simple three-parameter utility with full schema coverage but no annotations or output schema, the description covers usage, exclusions, authentication/payment, and key encoding behavior. It is nearly complete, though an explicit note about return format or invalid-input behavior would close the remaining gap.

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?

The schema already documents all three parameters at 100% coverage, so the baseline is a 3. The description adds some semantic value by clarifying bidirectional operation, URL-safe alphabet use, and proper UTF-8 handling beyond what the schema states.

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 description states a specific operation and resource: base64 encoding and decoding in both directions, including URL-safe alphabet and UTF-8 handling. It also distinguishes the tool from sibling utilities by explicitly ruling out hashing (/v1/util/sha256) and hex (/v1/util/hex).

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?

It gives explicit when-to-use guidance: putting bytes through headers, URLs, or JSON fields, or reading what came back, including payment headers. It also names the alternatives it should not be used for, which lets an agent route correctly without inspecting sibling schemas.

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.

Resources