Skip to main content
Glama

proxy_search_traffic

Search captured proxy traffic by URL, headers, and body previews using full-text queries.

Instructions

Full-text search across URLs, headers, and body previews of captured traffic.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch string
limitNoMax results (default: 20)

Implementation Reference

  • src/index.ts:65-65 (registration)
    Registration of the traffic tools module (which includes proxy_search_traffic) in the main MCP server setup.
    registerTrafficTools(server);
  • Export and function signature for registering all traffic tools, including proxy_search_traffic.
    export function registerTrafficTools(server: McpServer): void {
  • Tool handler for proxy_search_traffic: accepts query (string) and limit (number, default 20), calls proxyManager.searchTraffic(query), maps results to summaries, and returns JSON response via truncateResult.
    server.tool(
      "proxy_search_traffic",
      "Full-text search across URLs, headers, and body previews of captured traffic.",
      {
        query: z.string().describe("Search string"),
        limit: z.number().optional().default(20).describe("Max results (default: 20)"),
      },
      async ({ query, limit }) => {
        const results = proxyManager.searchTraffic(query).slice(0, limit);
        const summaries = results.map((t) => ({
          id: t.id,
          timestamp: t.timestamp,
          method: t.request.method,
          url: t.request.url,
          status: t.response?.statusCode ?? null,
          duration: t.duration ?? null,
        }));
    
        return {
          content: [{
            type: "text",
            text: truncateResult({
              status: "success",
              query,
              matches: summaries.length,
              results: summaries,
            }),
          }],
        };
      },
    );
  • Zod schema for proxy_search_traffic: query (required string) and limit (optional number, default 20).
    {
      query: z.string().describe("Search string"),
      limit: z.number().optional().default(20).describe("Max results (default: 20)"),
    },
  • Core search logic in ProxyManager.searchTraffic(): case-insensitive full-text search across URLs, request body previews, response body previews, and all header values.
    searchTraffic(query: string): CapturedExchange[] {
      const q = query.toLowerCase();
      return this.traffic.filter((t) => {
        if (t.request.url.toLowerCase().includes(q)) return true;
        if (t.request.bodyPreview.toLowerCase().includes(q)) return true;
        if (t.response?.bodyPreview.toLowerCase().includes(q)) return true;
        for (const v of Object.values(t.request.headers)) {
          if (v.toLowerCase().includes(q)) return true;
        }
        if (t.response) {
          for (const v of Object.values(t.response.headers)) {
            if (v.toLowerCase().includes(q)) return true;
          }
        }
        return false;
      });
    }
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that the search covers URLs, headers, and body previews, implying partial content. However, it omits details like rate limits, result format, or behavior on empty results, which limits transparency.

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, front-loaded sentence that conveys the core functionality efficiently. No extraneous information, making it highly concise.

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

Completeness3/5

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

Given the tool's simplicity (2 parameters, no output schema) and the absence of annotations, the description is minimally complete. It identifies what is searched but does not describe return format or pagination, which might be needed for complex use cases.

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% with both parameters having descriptions. The tool's description adds context about searching across specific traffic components, which supplements the schema. However, it does not provide deeper semantics beyond the schema's basic explanations.

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 clearly states the tool performs full-text search across URLs, headers, and body previews of captured traffic. It uses a specific verb and resource, and distinguishes itself from sibling tools like proxy_list_traffic (listing all) and proxy_search_session_bodies (more specific session search).

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 explicit guidance on when to use this tool versus alternatives like proxy_search_session_bodies or proxy_list_traffic. The description implies it is for general search, but does not mention exclusions or context, leaving the agent without clear direction.

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/yfe404/proxy-mcp'

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