Skip to main content
Glama

Escapar HTML

html-escape
Read-onlyIdempotent

Escapa &, <, > (y comillas para atributos) para insertar texto en HTML de forma segura. Cuándo: hay que leer, construir o revisar con exactitud una URL, una cabecera HTTP, un token, una versión, un rango de IP, un documento HTML o Markdown o un archivo para agentes. No para: decodificar referencias de caracteres HTML numéricas y unas 100 entidades con nombre comunes (html-unescape). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.

EN: Escapes &, <, > (and " ' for attribute contexts) so text can be safely inserted into HTML. When: a URL, HTTP header, token, version string, IP range, HTML or Markdown document or agent-readiness file has to be parsed, built or checked exactly. Not for: decoding HTML character references (html-unescape). Side effects: none (read-only, no network access, no stored state). [EN completo / full EN: inputSchema.description]

Input Schema

NameRequiredDescriptionDefault
textYesText (string; required).
attributeNoAlso escape quotes (boolean; optional; default true).

Output Schema

NameRequiredDescriptionDefault
htmlNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / text / examples
      Added value: +[
      +  "<a href=\"x\">Tom & Jerry's</a>"
      +]
  2. Changed1 schema field changed
    • addedInput schema / description
      Added value: +"EN: Escapes &, <, > (and \" ' for attribute contexts) so text can be safely inserted into HTML. When: a URL, HTTP header, token, version string, IP range, HTML or Markdown document or agent-readiness file has to be parsed, built or checked exactly. Not for: decoding HTML character references (html-unescape). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB."
  3. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered. The description still adds real value beyond them: determinism, no network/no stored state, and concrete limits (64 KB input, 1 s per call, 1 MB result).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Content is front-loaded and each clause is informative, but the entire block is duplicated in Spanish and English, roughly doubling length with zero added information. The bilingual repetition costs it conciseness.

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

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists so return values need not be described, and the description covers scope, exclusions, side effects and limits. Complete enough to call correctly; only the boilerplate when-list keeps it from a 5.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3, but the description adds meaning to the `attribute` flag by explaining that quotes are escaped "para atributos", clarifying when the default true matters. It does not add anything for `text` beyond the schema's example and maxLength.

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

Purpose5/5

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

States a specific verb and the exact characters escaped ("Escapa &, <, > (y comillas para atributos)"), and explicitly names the sibling it is not (html-unescape). An agent can distinguish it from html-unescape and from the other text tools without opening the schema.

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

Usage Guidelines4/5

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

Provides an explicit "Cuándo" section and a "No para" exclusion pointing at html-unescape, which is exactly the routing information needed. The when-list (URL, HTTP header, token, IP range, agent-readiness file) reads as generic boilerplate rather than HTML-insertion scenarios, which slightly dilutes the guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources