Skip to main content
Glama

decodeHtml

Convert HTML-encoded data back to its original format using this utility. Ideal for handling encoded strings from web sources or APIs.

Instructions

Decode HTML-encoded input data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYesData to decode

Implementation Reference

  • The handler function that decodes HTML-encoded input by replacing common HTML entities back to their original characters.
    handler: async ({ input }: { input: string }) => { const decoded = input .replace(/&amp;/g, '&') .replace(/&lt;/g, '<') .replace(/&gt;/g, '>') .replace(/&quot;/g, '"') .replace(/&#039;/g, "'"); return { content: [ { type: 'text', text: decoded } ] }; }
  • Input schema defining the expected 'input' parameter as a string for the decodeHtml tool.
    inputSchema: { type: 'object', properties: { input: { type: 'string', description: 'Data to decode' } }, required: ['input'] },
  • The complete registration of the 'decodeHtml' tool within the encodingTools object, including name, description, schema, and handler.
    decodeHtml: { name: 'decodeHtml', description: 'Decode HTML-encoded input data', inputSchema: { type: 'object', properties: { input: { type: 'string', description: 'Data to decode' } }, required: ['input'] }, handler: async ({ input }: { input: string }) => { const decoded = input .replace(/&amp;/g, '&') .replace(/&lt;/g, '<') .replace(/&gt;/g, '>') .replace(/&quot;/g, '"') .replace(/&#039;/g, "'"); return { content: [ { type: 'text', text: decoded } ] }; } }

Other Tools

Related 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/MissionSquad/mcp-helper-tools'

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