Skip to main content
Glama
paladini

devutils-mcp-server

html_encode

Convert special characters in text to HTML entities for safe web display and proper browser rendering.

Instructions

Encode special characters in a string to HTML entities.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYesThe string to HTML-encode

Implementation Reference

  • The handler for the html_encode tool is defined within the server.tool registration call in src/tools/encoding.ts. It takes a string input and replaces special characters with their corresponding HTML entities.
    server.tool(
      "html_encode",
      "Encode special characters in a string to HTML entities.",
      { input: z.string().describe("The string to HTML-encode") },
      async ({ input }) => {
        const encoded = input
          .replace(/&/g, "&")
          .replace(/</g, "<")
          .replace(/>/g, ">")
          .replace(/"/g, """)
          .replace(/'/g, "'");
        return { content: [{ type: "text" as const, text: encoded }] };
      }
    );

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/paladini/devutils-mcp-server'

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