Skip to main content
Glama

Convert text to or from base64, URL, HTML or punycode

encode
Read-only

Encode or decode text as base64, base64url, hex, URL (percent) encoding, HTML entities, punycode (domain names) or quoted-printable. Body { input, scheme, direction }, up to 1 MB. Invalid input to decode is a 400 that names the position of the first bad character. Unknown HTML entities are reported, not guessed. Pure code, no outside request. Price: $0.002 per successful call, paid with x402 (USDC on Base, Solana and 10 more networks); failed calls are not charged.

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": {
      "input": "<input>",
      "scheme": "<scheme>"
    },
    "name": "encode"
  }
}

Input Schema

NameRequiredDescriptionDefault
inputYesThe text to encode or decode (JSON body field)
schemeYesbase64, base64url, hex, url, html, punycode or quoted-printable
directionNoencode (default) or decode

Output Schema

NameRequiredDescriptionDefault
outputNo
schemeNo
sourceNo
checkedAtNo
directionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the annotations it discloses the 1 MB input cap, deterministic pure-code behavior with no outbound requests, precise error semantics (400 naming the first bad character position), non-guessing handling of unknown HTML entities, and the billing model including that failures are free. That is materially more than readOnlyHint/openWorldHint convey. The one point to watch is the tension between 'no outside request' and openWorldHint=true, which is partly resolved by the on-chain payment step it describes.

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?

It is front-loaded with the capability and supported schemes before limits, error behavior and pricing, and nearly every sentence carries actionable information. The pricing sentence is the longest and could be tightened, but cost awareness is relevant for an agent deciding whether to call.

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?

For a pure transformation tool with an output schema already covering return values, this is complete: schemes, direction, size limit, error shape and cost are all stated. An agent can call it correctly and interpret failures without further documentation.

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 coverage is 100% and the schema already names all three fields, their allowed values and the encode default, so the description's 'Body { input, scheme, direction }' is largely restatement. The only added meaning is the 1 MB size constraint on the input payload, which the schema does not state. Baseline 3 is appropriate.

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 title and first sentence state a specific verb (encode/decode) plus resource (text) and enumerate every supported scheme: base64, base64url, hex, URL percent-encoding, HTML entities, punycode, quoted-printable. That enumeration alone separates it from siblings like crypto_convert, entities and text_transliterate.

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

Usage Guidelines4/5

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

It gives clear context for use: the request shape, the 1 MB ceiling, and the default direction of encode, so an agent knows how to call it for either direction. It does not explicitly say when to prefer a sibling (e.g. crypto_convert for key material or entities for HTML parsing) or when not to use it, so it stops short of full routing guidance.

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