Skip to main content
Glama

Encoder / Decoder

encode_decode
Read-onlyIdempotent

Use this when you need to encode or decode text and want multi-byte and entity edge cases handled correctly rather than doing it by hand. Deterministic: same input, same output. The mode selects the operation: url-encode/url-decode (percent-encoding), html-encode/html-decode (entity table plus numeric character references), base64-encode/base64-decode (UTF-8 safe; decode tolerates URL-safe alphabet, whitespace, and missing padding), and unicode-encode/unicode-decode (\uXXXX and \u{...} escapes for non-ASCII). Every mode returns the same shape: {mode, output}. Example: mode base64-encode, text "héllo" -> output "aMOpbGxv".

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": {
      "mode": "<mode>",
      "text": "<text>"
    },
    "name": "encode_decode"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeYesOperation to perform.
textYesInput text.

Output Schema

NameRequiredDescriptionDefault
modeYesThe operation that was performed (echoed back).
outputYesThe encoded or decoded result string.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "mode": {
      +      "description": "The operation that was performed (echoed back).",
      +      "enum": [
      +        "url-encode",
      +        "url-decode",
      +        "html-encode",
      +        "html-decode",
      +        "base64-encode",
      +        "base64-decode",
      +        "unicode-encode",
      +        "unicode-decode"
      +      ],
      +      "type": "string"
      +    },
      +    "output": {
      +      "description": "The encoded or decoded result string.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "mode",
      +    "output"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations indicate readOnlyHint=true, idempotentHint=true, destructiveHint=false. The description adds 'Deterministic: same input, same output' and details output shape as {mode, output}, enhancing transparency beyond annotations. No contradictions.

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 four sentences, each serving a distinct purpose: usage guidance, determinism, mode details, output shape with example. It is front-loaded and concise with no extraneous information.

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?

Given the output schema exists, the description explains the return shape and provides an example. It covers edge cases for each mode. For a multi-mode utility tool, it is fully informative and complete.

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

Parameters5/5

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

Schema covers both parameters with descriptions. The description adds detailed semantics for each mode, explaining what each encoding/decoding type does (e.g., UTF-8 safe base64, unicode escapes). This significantly enriches the schema's minimal descriptions.

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 clearly states the tool encodes or decodes text, specifying multiple supported modes. It distinguishes from manual handling by emphasizing edge-case correctness, and though sibling tools like decode_jwt exist, the purpose is unambiguous.

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?

The description says 'Use this when... want multi-byte and entity edge cases handled correctly rather than doing it by hand.' This provides a clear context for use but does not explicitly exclude or compare with sibling tools that might also handle encoding/decoding (e.g., decode_jwt).

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