Skip to main content
Glama

pilot_network

Retrieve network requests from a circular buffer to debug API calls, check status codes, and monitor network activity. Clear buffer to isolate new requests after actions.

Instructions

Retrieve network requests (XHR, fetch, navigation, static assets) from a circular buffer. Use when the user wants to debug API calls, check request/response status codes, monitor network activity, or verify that a request was made after an action.

Parameters:

  • clear: Set to true to clear the buffer after reading (useful for isolating new requests after an action)

Returns: List of requests showing method, URL, status code, duration in ms, and response size in bytes. Or "(no network requests)" if the buffer is empty.

Errors: None — returns empty message if no entries exist.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clearNoClear the buffer after reading

Implementation Reference

  • The main tool handler for 'pilot_network' — registers and implements the MCP tool. Retrieves network requests from a circular buffer, with optional clear. Returns formatted entries showing method, URL, status, duration, and size.
      server.tool(
        'pilot_network',
        `Retrieve network requests (XHR, fetch, navigation, static assets) from a circular buffer.
    Use when the user wants to debug API calls, check request/response status codes, monitor network activity, or verify that a request was made after an action.
    
    Parameters:
    - clear: Set to true to clear the buffer after reading (useful for isolating new requests after an action)
    
    Returns: List of requests showing method, URL, status code, duration in ms, and response size in bytes. Or "(no network requests)" if the buffer is empty.
    
    Errors: None — returns empty message if no entries exist.`,
          { clear: z.boolean().optional().describe('Clear the buffer after reading') },
        async ({ clear }) => {
          await bm.ensureBrowser();
          if (clear) { networkBuffer.clear(); return { content: [{ type: 'text' as const, text: 'Network buffer cleared.' }] }; }
          if (networkBuffer.length === 0) return { content: [{ type: 'text' as const, text: '(no network requests)' }] };
          const text = networkBuffer.toArray().map(e =>
            `${e.method} ${e.url} → ${e.status || 'pending'} (${e.duration || '?'}ms, ${e.size || '?'}B)`
          ).join('\n');
          return { content: [{ type: 'text' as const, text }] };
        }
      );
  • NetworkEntry interface — defines the shape of network request data stored in the circular buffer (timestamp, method, url, status, duration, size).
    export interface NetworkEntry {
      timestamp: number;
      method: string;
      url: string;
      status?: number;
      duration?: number;
      size?: number;
    }
  • registerAllTools calls registerInspectionTools which registers 'pilot_network'. The tool is included in the 'full' profile (not in core or standard).
    export function registerAllTools(server: McpServer, bm: BrowserManager, profile: ToolProfile = 'full'): void {
      const allowed = PROFILE_TOOLS[profile];
      const effectiveServer = allowed ? createFilteredServer(server, allowed) : server;
    
      registerNavigationTools(effectiveServer, bm);
      registerSnapshotTools(effectiveServer, bm);
      registerInteractionTools(effectiveServer, bm);
      registerPageTools(effectiveServer, bm);
      registerInspectionTools(effectiveServer, bm);
      registerVisualTools(effectiveServer, bm);
      registerTabTools(effectiveServer, bm);
      registerSettingsTools(effectiveServer, bm);
      registerIframeTools(effectiveServer, bm);
      registerAutomationTools(effectiveServer, bm);
    }
  • CircularBuffer<NetworkEntry> instance and addNetworkEntry helper — the data store backing the pilot_network tool. Entries are populated by Playwright page event listeners in browser-manager.ts.
    // ─── Buffer Instances ───────────────────────────────────────
    
    const HIGH_WATER_MARK = 50_000;
    
    export const consoleBuffer = new CircularBuffer<LogEntry>(HIGH_WATER_MARK);
    export const networkBuffer = new CircularBuffer<NetworkEntry>(HIGH_WATER_MARK);
    export const dialogBuffer = new CircularBuffer<DialogEntry>(HIGH_WATER_MARK);
  • Playwright event listeners that populate the network buffer — page.on('request') captures method/URL, page.on('response') captures status/duration, page.on('requestfinished') captures response size.
    page.on('request', (req) => {
      addNetworkEntry({
        timestamp: Date.now(),
        method: req.method(),
        url: req.url(),
      });
    });
    
    page.on('response', (res) => {
      const url = res.url();
      const status = res.status();
      for (let i = networkBuffer.length - 1; i >= 0; i--) {
        const entry = networkBuffer.get(i);
        if (entry && entry.url === url && !entry.status) {
          networkBuffer.set(i, { ...entry, status, duration: Date.now() - entry.timestamp });
          break;
        }
      }
    });
    
    page.on('requestfinished', async (req) => {
      try {
        const res = await req.response();
        if (res) {
          const url = req.url();
          const body = await res.body().catch(() => null);
          const size = body ? body.length : 0;
          for (let i = networkBuffer.length - 1; i >= 0; i--) {
            const entry = networkBuffer.get(i);
            if (entry && entry.url === url && !entry.size) {
              networkBuffer.set(i, { ...entry, size });
              break;
            }
          }
        }
      } catch {}
    });
Behavior4/5

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

No annotations are provided, so the description carries full weight. It discloses that data comes from a circular buffer, the clear parameter behavior, return format (method, URL, status, duration, size), and error handling (returns empty message). It does not mention buffer size or concurrency effects, but overall it is transparent.

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 succinct and well-structured: a summary sentence, usage guidance, parameter explanation, return description, and error handling. Every sentence provides value without redundancy.

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

Completeness4/5

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

Given the simplicity of the tool (one parameter, no output schema), the description covers purpose, usage, parameters, return format, and errors. It does not mention buffer capacity or retention policy, but it is sufficient for typical debugging scenarios.

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

Parameters4/5

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

Schema coverage is 100%, providing baseline 3. The description adds meaning for the 'clear' parameter: 'useful for isolating new requests after an action', which helps in deciding when to set it to true.

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 'Retrieve network requests (XHR, fetch, navigation, static assets) from a circular buffer.' The verb 'retrieve' and resource 'network requests' are specific. Among siblings like pilot_intercept and pilot_console, this tool's purpose is distinct and unambiguous.

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?

The description explicitly lists use cases: debug API calls, check status codes, monitor network activity, verify requests after actions. It does not explicitly mention when not to use it or alternatives, but the given contexts are clear and actionable.

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

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