Skip to main content
Glama

getNetworkLogs

Retrieve and analyze network logs from browser sessions to monitor HTTP requests, responses, and performance data for debugging and auditing purposes.

Instructions

Check ALL our network logs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'getNetworkLogs' tool. It fetches network success logs from the discovered browser connector server at '/network-success' endpoint and returns the JSON response as formatted text.
    server.tool("getNetworkLogs", "Check ALL our network logs", async () => {
      return await withServerConnection(async () => {
        const response = await fetch(
          `http://${discoveredHost}:${discoveredPort}/network-success`
        );
        const json = await response.json();
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(json, null, 2),
            },
          ],
        };
      });
    });
  • Registers the 'getNetworkLogs' tool with MCP server using server.tool(), including description and inline handler implementation.
    server.tool("getNetworkLogs", "Check ALL our network logs", async () => {
      return await withServerConnection(async () => {
        const response = await fetch(
          `http://${discoveredHost}:${discoveredPort}/network-success`
        );
        const json = await response.json();
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(json, null, 2),
            },
          ],
        };
      });
    });
  • Helper function 'withServerConnection' used by the getNetworkLogs handler (and others) to ensure server discovery and handle reconnections before making API calls to the browser connector.
    async function withServerConnection<T>(
      apiCall: () => Promise<T>
    ): Promise<T | any> {
      // Attempt to discover server if not already discovered
      if (!serverDiscovered) {
        const discovered = await discoverServer();
        if (!discovered) {
          return {
            content: [
              {
                type: "text",
                text: "Failed to discover browser connector server. Please ensure it's running.",
              },
            ],
            isError: true,
          };
        }
      }
    
      // Now make the actual API call with discovered host/port
      try {
        return await apiCall();
      } catch (error: any) {
        // If the request fails, try rediscovering the server once
        console.error(
          `API call failed: ${error.message}. Attempting rediscovery...`
        );
        serverDiscovered = false;
    
        if (await discoverServer()) {
          console.error("Rediscovery successful. Retrying API call...");
          try {
            // Retry the API call with the newly discovered connection
            return await apiCall();
          } catch (retryError: any) {
            console.error(`Retry failed: ${retryError.message}`);
            return {
              content: [
                {
                  type: "text",
                  text: `Error after reconnection attempt: ${retryError.message}`,
                },
              ],
              isError: true,
            };
          }
        } else {
          console.error("Rediscovery failed. Could not reconnect to server.");
          return {
            content: [
              {
                type: "text",
                text: `Failed to reconnect to server: ${error.message}`,
              },
            ],
            isError: true,
          };
        }
      }
    }
Behavior2/5

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

With no annotations, the description carries full burden but only states the action without behavioral details. It doesn't disclose if this is read-only, destructive, requires auth, has rate limits, or what the output entails (e.g., format, pagination). This is a significant gap for a tool with zero annotation coverage.

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 with no wasted words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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?

Given no annotations, no output schema, and the tool's potential complexity (network logs could involve large data), the description is incomplete. It lacks details on behavior, output format, or how it fits with siblings, making it inadequate for informed use.

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?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add param info, but that's acceptable here; baseline is 4 for zero parameters as it doesn't mislead or omit required details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Check ALL our network logs' states a clear verb ('Check') and resource ('network logs'), but it's vague about what 'Check' means (e.g., list, retrieve, inspect) and doesn't distinguish it from siblings like 'getNetworkErrors' or 'wipeLogs'. It's not tautological but lacks specificity.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention siblings like 'getNetworkErrors' for error-specific logs or 'wipeLogs' for deletion, leaving usage context implied at best.

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/oenius/browser-tools-mcp'

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