Skip to main content
Glama
code-alchemist01

Development Tools MCP Server

analyze_network_requests

Analyze network requests from web pages to identify API calls, track resource loading, and monitor data transfers for development and debugging purposes.

Instructions

Analyze all network requests made by a web page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to analyze
timeoutNoAnalysis timeout in milliseconds

Implementation Reference

  • Handler logic for the 'analyze_network_requests' tool: extracts URL and timeout parameters, invokes APIScraper.analyzeNetworkRequests, formats and returns the list of network requests with key details.
    case 'analyze_network_requests': {
      const url = params.url as string;
      const timeout = params.timeout as number;
      const requests = await apiScraper.analyzeNetworkRequests(url, { timeout });
      return {
        total: requests.length,
        requests: requests.map((r) => ({
          url: r.url,
          method: r.method,
          status: r.status,
          type: r.type,
          responseTime: r.responseTime,
        })),
      };
    }
  • Input schema definition specifying required 'url' parameter and optional 'timeout' for the analyze_network_requests tool.
    inputSchema: {
      type: 'object',
      properties: {
        url: {
          type: 'string',
          description: 'URL to analyze',
        },
        timeout: {
          type: 'number',
          description: 'Analysis timeout in milliseconds',
          default: 30000,
        },
      },
      required: ['url'],
    },
  • Registration of the 'analyze_network_requests' tool in the apiDiscoveryTools array, including name, description, and input schema.
    {
      name: 'analyze_network_requests',
      description: 'Analyze all network requests made by a web page',
      inputSchema: {
        type: 'object',
        properties: {
          url: {
            type: 'string',
            description: 'URL to analyze',
          },
          timeout: {
            type: 'number',
            description: 'Analysis timeout in milliseconds',
            default: 30000,
          },
        },
        required: ['url'],
      },
    },
  • Core helper method in APIScraper class that uses Playwright to launch a browser, navigate to the URL, monitor all network requests and responses, capture details like URL, method, status, type, and response time.
    async analyzeNetworkRequests(url: string, options?: { timeout?: number }): Promise<NetworkRequest[]> {
      if (!Validators.isValidUrl(url)) {
        throw new Error('Invalid URL');
      }
    
      const browser = await this.getBrowser();
      const page = await browser.newPage();
      const requests: NetworkRequest[] = [];
      const startTime = Date.now();
    
      try {
        page.on('request', (request) => {
          requests.push({
            url: request.url(),
            method: request.method(),
            status: 0,
            statusText: '',
            headers: request.headers(),
            requestHeaders: request.headers(),
          });
        });
    
        page.on('response', (response) => {
          const request = requests.find((r) => r.url === response.url());
          if (request) {
            request.status = response.status();
            request.statusText = response.statusText();
            request.type = response.headers()['content-type'] || '';
            request.responseTime = Date.now() - startTime;
          }
        });
    
        await page.goto(url, {
          waitUntil: 'networkidle',
          timeout: options?.timeout || 30000,
        });
    
        await page.waitForTimeout(2000);
    
        return requests;
      } finally {
        await page.close();
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but offers minimal information. It mentions analyzing 'all network requests' but doesn't specify whether this requires special permissions, what format results are returned in, whether it performs active requests or analyzes existing logs, or any rate limits. For a tool that likely interacts with web resources, this lack of behavioral context is a significant gap.

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, efficient sentence that communicates the core functionality without unnecessary words. It's appropriately sized for a tool with two parameters and no complex behavioral nuances to explain. Every word earns its place by specifying what is analyzed and the scope of analysis.

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?

For a tool that analyzes network requests with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what kind of analysis is performed, what data is returned, whether it makes actual requests or analyzes existing data, or any prerequisites. Given the complexity of network analysis and the lack of structured metadata, the description should provide more operational context.

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

Parameters3/5

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

Schema description coverage is 100%, providing complete documentation for both parameters ('url' and 'timeout'). The description adds no additional parameter semantics beyond what's already in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no parameter information in the description.

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 the action ('analyze') and target resource ('network requests made by a web page'), making the purpose immediately understandable. It distinguishes itself from siblings like 'scrape_html' or 'test_api_endpoint' by focusing specifically on network request analysis rather than content extraction or endpoint testing. However, it doesn't specify what aspects of network requests are analyzed (e.g., timing, headers, size), which prevents a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With many sibling tools available for web analysis (like 'scrape_dynamic_content', 'test_api_endpoint', 'scan_security_issues'), there's no indication whether this tool is for performance analysis, security auditing, or general monitoring. The agent must infer usage context from the tool name alone.

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/code-alchemist01/development-tools-mcp-Server'

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