encodeUrl
Convert input data into URL-encoded format using the encoding tool in the MCP server, ensuring compatibility with web standards. Ideal for processing strings in URLs.
Instructions
Encode input data to URL-encoded format
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | Data to encode |
Implementation Reference
- src/tools/encoding.ts:65-75 (handler)The async handler function that URL-encodes the input using encodeURIComponent and returns the encoded string in MCP content format.handler: async ({ input }: { input: string }) => { const encoded = encodeURIComponent(input); return { content: [ { type: 'text', text: encoded } ] }; }
- src/tools/encoding.ts:55-64 (schema)Input schema defining a required 'input' string parameter for the tool.inputSchema: { type: 'object', properties: { input: { type: 'string', description: 'Data to encode' } }, required: ['input'] },
- src/tools/encoding.ts:52-76 (registration)Full tool registration object for encodeUrl, exported as part of encodingTools, which is later included in the main allTools object.encodeUrl: { name: 'encodeUrl', description: 'Encode input data to URL-encoded format', inputSchema: { type: 'object', properties: { input: { type: 'string', description: 'Data to encode' } }, required: ['input'] }, handler: async ({ input }: { input: string }) => { const encoded = encodeURIComponent(input); return { content: [ { type: 'text', text: encoded } ] }; } },