Skip to main content
Glama

Extraer enlaces de HTML

html-links-extract
Read-onlyIdempotent

Extrae enlaces de un HTML con su texto, rel y target, resuelve URL relativas con una base opcional y clasifica cada uno como interno, externo, mailto, tel, ancla u otro. Deduplicación opcional. 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: extraer tablas de un HTML como filas de texto, detectando encabezados (html-tables-extract). 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: Extracts links from HTML with their text, rel and target, resolves relative URLs against an optional base, and classifies each as internal, external, mailto, tel, anchor or other. Optional de-duplication. [EN completo / full EN: inputSchema.description]

Input Schema

NameRequiredDescriptionDefault
htmlYesHTML (string; required).
dedupeNoKeep only the first link per URL (boolean; optional; default false).
base_urlNoBase URL for relative links (string; optional; up to 2048 chars).
max_linksNoMax links (integer; optional; default 1000; min 1; max 5000).

Output Schema

NameRequiredDescriptionDefault
countNo
linksNo
by_kindNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / html / examples
      Added value: +[
      +  "<a href=\"a.html\">A</a><a href=\"a.html\">A otra vez</a>"
      +]
  2. Changed1 schema field changed
    • addedInput schema / description
      Added value: +"EN: Extracts <a href> links from HTML with their text, rel and target, resolves relative URLs against an optional base, and classifies each as internal, external, mailto, tel, anchor or other. Optional de-duplication. 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: extracting <table> elements from HTML into rows of cell text, with header detection (html-tables-extract). 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/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive and closed-world, but the description still adds substantive traits: no network access, no stored state, determinism, and explicit limits (1 s per call, 1 MB result). One flaw: it states 'input JSON up to 64 KB' while the schema allows html up to 1,048,576 chars, an internal inconsistency that could mislead about the real ceiling.

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?

The opening sentence is well front-loaded and dense with useful detail, but the description is bloated by a full Spanish block plus an English restatement plus a boilerplate 'Cuándo' trigger list containing items irrelevant to link extraction. Roughly half the text does not earn its place for this specific tool.

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?

With an output schema present and 100% param coverage, the description supplies what structured fields cannot: classification categories, determinism, no network, and runtime/size limits. The only gap is the conflicting 64 KB input claim versus the 1 MB schema maxLength, which should be reconciled.

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%, so the four parameters are already documented. The description restates the optional base and optional de-duplication without adding semantics beyond the schema (e.g. what happens to unresolvable relative URLs when base_url is absent, or whether max_links truncation is silent) — baseline 3 is appropriate.

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 resource (extract <a href> links from HTML) plus the exact output facets (text, rel, target), relative-URL resolution, and the classification buckets internal/external/mailto/tel/anchor/other. An agent can immediately distinguish it from html-tables-extract or html-meta-extract 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?

The 'No para' clause names a concrete sibling (html-tables-extract) and the exact task it owns, which is real routing guidance. The 'Cuándo' clause, however, is a generic trigger list (HTTP header, token, version, IP range, Markdown) that reads as family boilerplate rather than reasons specific to link extraction, and it never mentions markdown-links-extract as the alternative for Markdown input.

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