Skip to main content
Glama

URL encode: percent-encode text for use in a URL

url_encode
Read-only

Percent-encode text for use in a URL query value (encodeURIComponent) and as a full URL (encodeURI). Use when building query strings. Example: text=a b&c=d/é. Price $0.01/call via x402 USDC or a card key (/credits), first 25 free; failed calls free. Reads or computes only and changes nothing; each call is charged, so repeats are not free.

Input Schema

NameRequiredDescriptionDefault
textYesThe text to encode

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. Added

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare readOnly/destructive/openWorld, and the description adds non-obvious operational context: it is billed per call, first 25 free, failed calls free, and repeats are not free. That cost/idempotency information is exactly the kind of trait annotations cannot express and it is consistent with idempotentHint=false (repeated calls incur charge). It does not describe the return format, which keeps it from 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: purpose and use case come first, example second, pricing last. The billing sentence is long but decision-relevant for an agent that must weigh cost; minor verbosity in "first 25 free; failed calls free" is acceptable.

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

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-parameter, no-output-schema, read-only tool this covers safety, cost, and a usage cue. It is still missing the output shape (string returned vs. wrapped) and does not resolve the encode vs. full-URL behavior gap, which is the main thing an agent could get wrong.

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% so the single `text` parameter is already documented; the example (`text=a b&c=d/é`) usefully shows what characters get encoded. However it never clarifies whether `text` is treated as a query value or as a whole URL, which is the one semantic the agent actually needs and which the description itself raises.

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

Purpose4/5

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

States a specific verb+resource (percent-encode text for URLs) and names two concrete encoding semantics, encodeURIComponent and encodeURI, which differentiates it from generic string tools. Slight ding: with a single `text` parameter there is no way for the agent to pick between the two modes, so what the tool actually does per call is left partly ambiguous.

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

Usage Guidelines3/5

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

Gives one concrete use case ("Use when building query strings") but no exclusion or alternative, even though the obvious sibling `url_decode` exists and the encodeURI-vs-encodeURIComponent choice is not resolvable from the guidance. A reader knows roughly when, but not precisely which mode applies or when to prefer another tool.

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.