Skip to main content
Glama

url_encode

Percent-encode a string to safely include as a URL component. Escapes characters like &, =, #, spaces, and non-ASCII characters using encodeURIComponent semantics. Pass only the component, not the full URL. Returns encoded string.

Instructions

Percent-encode an arbitrary string so it is safe to embed as a URL component (query value, path segment, or fragment). Use to escape characters like &, =, #, spaces, and non-ASCII before appending to a URL; uses encodeURIComponent semantics, so / is encoded — do not pass a full URL, only the component that needs escaping. Pure local transform with no network calls. Returns the percent-encoded string as plain text. Always succeeds.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYesString to percent-encode, e.g. a query parameter value like "hello world" or "a=b&c=d". Pass only the component, not the full URL.
Behavior5/5

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

With no annotations, the description fully discloses behavior: it is a pure local transform with no network calls, always succeeds, uses encodeURIComponent semantics (so / is encoded), and returns plain text. This covers safety, side effects, and success guarantee.

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?

Three sentences with no wasted words. The first sentence states purpose, the second adds usage guidelines and semantics, the third addresses side effects and output. Front-loaded and efficient.

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 single-parameter tool with no output schema, the description covers everything: purpose, input constraints, encoding details, side effects, and return type. No gaps remain.

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?

Schema coverage is 100% with a good description. The tool description adds extra examples (e.g., 'hello world', 'a=b&c=d') and reiterates to pass only the component, which adds value 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?

The description clearly states the tool's purpose: percent-encode a string for safe URL embedding. It uses a specific verb and resource ('Percent-encode an arbitrary string') and distinguishes it from url_decode by focusing on encoding.

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?

Explicitly tells when to use (escape characters like &, =, #) and what not to do (do not pass a full URL, only the component). Mentions the encoding semantics (encodeURIComponent) and that it's a local transform, helping the agent decide when to invoke.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hikmahtech/drwhome'

If you have feedback or need assistance with the MCP directory API, please join our Discord server