Skip to main content
Glama

pilot_page_links

Extract all links from a webpage as text and URL pairs for automated navigation and content analysis.

Instructions

Get all links on the page as text + href pairs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The 'pilot_page_links' tool implementation which extracts and formats links from the current browser page.
    server.tool(
      'pilot_page_links',
      'Get all links on the page as text + href pairs.',
      {},
      async () => {
        await bm.ensureBrowser();
        try {
          const links = await bm.getPage().evaluate(() =>
            [...document.querySelectorAll('a[href]')].map(a => ({
              text: a.textContent?.trim().slice(0, 120) || '',
              href: (a as HTMLAnchorElement).href,
            })).filter(l => l.text && l.href)
          );
          const result = links.map(l => `${l.text} → ${l.href}`).join('\n');
          return { content: [{ type: 'text' as const, text: result || '(no links found)' }] };
        } catch (err) {
          return { content: [{ type: 'text' as const, text: wrapError(err) }], isError: true };
        }
      }
    );

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/TacosyHorchata/Pilot'

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