url_encode
Convert strings into URL-safe format by applying percent-encoding to special characters for web compatibility.
Instructions
URL-encode a string (percent-encoding).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | The string to URL-encode |
Implementation Reference
- src/tools/encoding.ts:41-48 (handler)Registration and handler implementation for the `url_encode` tool.
server.tool( "url_encode", "URL-encode a string (percent-encoding).", { input: z.string().describe("The string to URL-encode") }, async ({ input }) => ({ content: [{ type: "text" as const, text: encodeURIComponent(input) }], }) );