pilot_page_links
Return all links from a web page as text and URL pairs, with an option to limit the total characters retrieved.
Instructions
Get all links on the page as text + href pairs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max_chars | No | Max characters to return (default: 20000) |
Implementation Reference
- extension/content.js:442-448 (helper)Browser extension content script helper that collects up to 100 links from the page with their text (trimmed to 80 chars) and href. Used when the browser extension is active (ext is truthy).
function pageLinks() { const links = Array.from(document.querySelectorAll('a[href]')).slice(0, 100).map(a => ({ text: a.textContent.trim().slice(0, 80), href: a.href, })); return { links, count: links.length }; } - extension/background.js:124-130 (helper)Background script relay: routes 'page_links' messages to the content script via relayToContent.
case 'page_links': case 'page_forms': case 'element_state': case 'evaluate': case 'page_text': case 'page_html': return await relayToContent(type, payload, tabId);