Skip to main content
Glama

extract_links

Parse HTML to categorize all links by type—anchors, forms, scripts, images, and CSS—and resolve relative URLs with an optional base URL. Build a crawl tree from a page response without manually searching source.

Instructions

Extract all links (anchors, forms, scripts, images) from HTML. Useful for building a crawl tree without manually grep'ing the response body. html: HTML string base_url: optional base URL for resolving relative links only_same_origin: if True and base_url given, only return links to same host Returns: lists of links by category (anchors, forms, scripts, images, css)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
htmlYes
base_urlNo
only_same_originNo
Behavior4/5

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

With no annotations, the description must carry behavioral information. It clearly defines the function as extraction from an HTML string, lists return categories, and explains parameter effects. It doesn't describe side effects, but the operation is inherently read-only and side-effect-free, which is reasonable to infer. It could explicitly state that no network request is made, but the input parameter 'html' makes this clear.

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 concise and well-organized: first the main purpose, then a usage scenario, then parameter explanations, then the return structure. Every sentence adds value without redundancy.

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

Completeness5/5

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

For a simple extraction tool with no output schema or nested objects, the description is fully complete. It covers input parameters, return categories, and a typical use case. No critical information is missing.

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

Parameters5/5

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

The schema has 0% description coverage, so the description fully compensates. It explains 'html' as the input string, 'base_url' as resolving relative links, and 'only_same_origin' with its condition. This adds meaning beyond the raw schema.

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?

The description states a specific action ('Extract all links') on a specific resource ('HTML') and enumerates the link types (anchors, forms, scripts, images). This clearly distinguishes it from siblings like html_to_text or http_request, which have different purposes.

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?

It provides a concrete use case: 'building a crawl tree without manually grep'ing the response body.' This tells the user when to use it. However, it doesn't explicitly mention when not to use it or point to alternative tools, which would be even stronger.

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

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/Neeraj829784/kali-mcp'

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