Skip to main content
Glama

pilot_page_diff

Compare webpage content between two URLs to identify differences in staging versus production environments or other page versions.

Instructions

Text diff between two URLs — compare staging vs production, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
url1YesFirst URL
url2YesSecond URL

Implementation Reference

  • Implementation of the pilot_page_diff MCP tool, which compares the textual content of two URLs using diff-lines.
    server.tool(
      'pilot_page_diff',
      'Text diff between two URLs — compare staging vs production, etc.',
      {
        url1: z.string().describe('First URL'),
        url2: z.string().describe('Second URL'),
      },
      async ({ url1, url2 }) => {
        await bm.ensureBrowser();
        try {
          const page = bm.getPage();
          await validateNavigationUrl(url1);
          await page.goto(url1, { waitUntil: 'domcontentloaded', timeout: 15000 });
          const text1 = await getCleanText(page);
    
          await validateNavigationUrl(url2);
          await page.goto(url2, { waitUntil: 'domcontentloaded', timeout: 15000 });
          const text2 = await getCleanText(page);
    
          const changes = Diff.diffLines(text1, text2);
          const output: string[] = [`--- ${url1}`, `+++ ${url2}`, ''];
    
          for (const part of changes) {
            const prefix = part.added ? '+' : part.removed ? '-' : ' ';
            const lines = part.value.split('\n').filter(l => l.length > 0);
            for (const line of lines) {
              output.push(`${prefix} ${line}`);
            }
          }
    
          return { content: [{ type: 'text' as const, text: output.join('\n') }] };
        } 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