Skip to main content
Glama

URL encode

url_encode
Read-onlyIdempotent

Percent-encode text for safe use in URLs as query values, path segments, or entire URLs using UTF-8, matching JavaScript encodeURIComponent or encodeURI behavior.

Instructions

Percent-encode text for URLs, exactly like JavaScript encodeURIComponent ("component", default) or encodeURI ("full"). UTF-8 based. Web version: https://s3eidat.github.io/url-toolkit/

Input Schema

NameRequiredDescriptionDefault
modeNo"component" = encodeURIComponent (for one query value or path segment; escapes / ? & = #). "full" = encodeURI (a whole URL; keeps those).component
textYesText to encode.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, and closed-world, so the safety profile is covered. The description adds genuinely new behavioral facts: encoding is UTF-8 based, and the output is byte-for-byte the same as the named JavaScript built-ins, which tells the agent exactly what to expect in the result.

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?

Two front-loaded sentences carry the essential semantic anchor, and the trailing project URL is small and potentially useful for verifying behavior. Slightly more than strictly necessary for a tool this simple.

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 two-parameter, single-purpose transform with full schema coverage and no output schema, the description gives enough to call it correctly. It does not state the return value explicitly (the encoded string), but that is near-obvious given the JS equivalence.

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 mode parameter's enum description already spells out the encodeURIComponent/encodeURI mapping, so the description largely repeats structured data. The 'exactly like JavaScript ... ("component", default)' phrasing reinforces the default but adds little beyond the schema.

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?

States a specific verb (percent-encode) and resource (text for URLs), and pins the semantics to two well-known JavaScript functions so the agent knows exactly which transformation it is. It is clearly distinguishable from siblings like url_decode, url_parse, and text_escape.

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?

The description implies when each mode applies through the encodeURIComponent/encodeURI analogy, but the concrete guidance ('for one query value or path segment' vs 'a whole URL') lives in the schema, not the description. No alternative tool is named and no exclusion is given.

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