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(/&/g, '&')
        .replace(/</g, '<')
        .replace(/>/g, '>')
        .replace(/"/g, '"')
        .replace(/'/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(/&/g, '&')
          .replace(/</g, '<')
          .replace(/>/g, '>')
          .replace(/"/g, '"')
          .replace(/'/g, "'");
        return {
          content: [
            {
              type: 'text',
              text: decoded
            }
          ]
        };
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the operation but doesn't disclose behavioral traits like error handling, performance characteristics, output format, or whether it handles partial/malformed input. 'Decode' implies a transformation, but no additional context about the process is given.

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?

The description is a single, efficient sentence that directly states the tool's function with zero wasted words. It's appropriately sized for a simple transformation tool and front-loads the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/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 and no annotations, the description is minimally adequate but lacks completeness. It doesn't explain what the decoded output looks like, potential side effects, or error conditions. Given the simplicity, it meets basic needs but leaves gaps an agent might need to infer.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the single parameter 'input' documented as 'Data to decode'. The description adds no additional meaning beyond this, such as examples of HTML-encoded data or format constraints. With high schema coverage, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'decode' and the resource 'HTML-encoded input data', making the purpose immediately understandable. It distinguishes from siblings like decodeBase64 and decodeUrl by specifying HTML encoding, but doesn't explicitly contrast with encodeHtml beyond the inverse operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like decodeUrl or decodeBase64. The description implies usage for HTML-encoded data but doesn't specify scenarios, prerequisites, or exclusions. The sibling tool list includes related encoding/decoding tools, but no comparative context is given.

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

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