Skip to main content
Glama

extract_links

Extract hyperlinks from a webpage or a selected section, optionally removing duplicate URLs and capping the number of results to simplify navigation analysis.

Instructions

Extract anchors from the page or a subtree. dedupe=true collapses links sharing an href (nav/footer noise); limit caps the count.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
tabIdNoTab id (default: active tab)
dedupeNo
frameIdNoFrame id from frames_list
selectorNo
allFramesNoAct on the first match in ANY frame (the element may be in an iframe)
sameOriginOnlyNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.9.5
    • changedInput schema / properties / allFrames / description
      Previous value: -"Search every frame of the tab and act on the first that matches - use when a selector should match but does not (the element is in an iframe)"New value: +"Act on the first match in ANY frame (the element may be in an iframe)"
    • changedInput schema / properties / frameId / description
      Previous value: -"Act inside this frame (ids come from frames_list)"New value: +"Frame id from frames_list"
    • changedInput schema / properties / tabId / description
      Previous value: -"Target tab id (defaults to the active tab)"New value: +"Tab id (default: active tab)"
  2. Changed2 schema fields changedv0.7.0
    • addedInput schema / properties / allFrames
      Added value: +{
      +  "description": "Search every frame of the tab and act on the first that matches - use when a selector should match but does not (the element is in an iframe)",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / frameId
      Added value: +{
      +  "description": "Act inside this frame (ids come from frames_list)",
      +  "type": "number"
      +}
  3. Changed2 schema fields changedv0.6.6
    • addedInput schema / properties / dedupe
      Added value: +{
      +  "type": "boolean"
      +}
    • addedInput schema / properties / limit
      Added value: +{
      +  "type": "number"
      +}
  4. First observedv0.6.2

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations provided, the description carries the behavioral transparency burden. It does disclose meaningful behavior around dedupe (collapses links sharing href) and limit (caps count). But it does not mention read-only status, same-origin filtering behavior, frame/allFrames semantics, or what happens when no anchors are found.

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 front-loaded sentence: it states the core function first, then provides two concise parameter clarifications. Every clause earns its place and there is no boilerplate or redundancy.

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

Completeness2/5

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

With 7 parameters, no output schema, and no annotations, the description covers only dedupe and limit meaningfully. It is missing return format details, sameOriginOnly semantics, how to specify the subtree via selector, and behavior across frames, making it incomplete for reliable invocation.

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

Parameters2/5

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

Schema description coverage is only 43%, so the description must compensate. It adds real meaning for dedupe and limit, and 'subtree' hints at selector usage. However, sameOriginOnly is left completely unexplained and the selector parameter is not clearly described as the mechanism for selecting the subtree, leaving important parameters ambiguous.

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 a specific action ('Extract anchors') and a scope ('the page or a subtree'), which distinguishes it from sibling content tools like get_text or get_html. It could more explicitly say that it returns anchor URLs/hrefs, but the core purpose is unambiguous.

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

Usage Guidelines3/5

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

The description gives useful context for when to enable dedupe ('nav/footer noise') and limit, and mentions the option of a subtree. However, it does not explicitly contrast this tool with alternatives like get_html, read_as_markdown, or get_text, nor does it explain when to use sameOriginOnly or frame targeting.

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