Skip to main content
Glama

getInterceptInfo

Retrieve base64-encoded interception details for specific URLs, including request and response data, to monitor and analyze network traffic using Whistle MCP Server. Supports regex and optional time and count parameters for precise results.

Instructions

获取URL的拦截信息(请求/响应皆以base64编码)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNo请求数量(可选)
startTimeNo开始时间ms(可选)
urlNo要检查拦截信息的URL (支持正则表达式)

Implementation Reference

  • Core handler function in WhistleClient class that fetches intercepted request data from Whistle's /cgi-bin/get-data API endpoint using startTime, count, and other parameters.
    async getInterceptInfo(
      options: {
        startTime?: string;
        count?: number;
        lastRowId?: string;
      } = {}
    ): Promise<any> {
      const timestamp = Date.now();
      const clientId = `${timestamp}-${Math.floor(Math.random() * 100)}`;
    
      const params = {
        clientId,
        startLogTime: -2,
        startSvrLogTime: -2,
        ids: "",
        startTime: options.startTime || `${timestamp}-000`,
        dumpCount: 0,
        lastRowId: options.lastRowId || options.startTime || `${timestamp}-000`,
        logId: "",
        count: options.count || 20,
        _: timestamp,
      };
    
      const response = await axios.get(`${this.baseUrl}/cgi-bin/get-data`, {
        params,
        headers: {
          Accept: "application/json, text/javascript, */*; q=0.01",
          "Cache-Control": "no-cache",
          Pragma: "no-cache",
          "X-Requested-With": "XMLHttpRequest",
        },
      });
    
      return response.data.data || [];
    }
  • src/index.ts:387-416 (registration)
    FastMCP tool registration for 'getInterceptInfo', including schema, description, and execute wrapper that filters results by 'url' using regex or string match, then formats response.
    server.addTool({
      name: "getInterceptInfo",
      description: "获取URL的拦截信息(请求/响应皆以base64编码)",
      parameters: z.object({
        url: z.string().optional().describe("要检查拦截信息的URL (支持正则表达式)"),
        startTime: z.string().optional().describe("开始时间ms(可选)"),
        count: z.number().optional().describe("请求数量(可选)"),
      }),
      execute: async (args) => {
        const { url = '', startTime = (Date.now() - 1000).toString(), count } = args;
        const result = await whistleClient.getInterceptInfo({ startTime, count });
        const filteredResult = Object.values(result.data).filter((item: any) => {
          if (url) {
            try {
              const regex = new RegExp(url);
              return Array.isArray(item.url) 
                ? item.url.some((u: string) => regex.test(u)) 
                : regex.test(item.url);
            } catch (e) {
              // 正则表达式无效时,回退到简单的字符串包含检查
              return Array.isArray(item.url) 
                ? item.url.some((u: string | string[]) => u.includes(url)) 
                : item.url.includes(url);
            }
          }
          return true;
        });
        return formatResponse(filteredResult);
      },
    });
  • Input schema using Zod for validating tool parameters: optional url (string, supports regex), startTime (string ms timestamp), count (number).
    parameters: z.object({
      url: z.string().optional().describe("要检查拦截信息的URL (支持正则表达式)"),
      startTime: z.string().optional().describe("开始时间ms(可选)"),
      count: z.number().optional().describe("请求数量(可选)"),
    }),
Behavior2/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 of behavioral disclosure. It mentions that output is base64-encoded, which is useful, but fails to describe critical behaviors: whether this is a read-only operation, what the return format looks like (e.g., list of objects), if there are rate limits, or authentication requirements. For a tool with no annotations, this leaves significant gaps in understanding how it behaves.

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 front-loads the core purpose ('获取URL的拦截信息') and adds a crucial detail about base64 encoding. There is no wasted verbiage, and every word contributes to understanding the tool's function.

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 the complexity of interception tools and the lack of both annotations and an output schema, the description is incomplete. It doesn't explain what 'intercept information' entails (e.g., headers, body, timing), how results are structured, or behavioral constraints. For a tool that likely returns sensitive network data, more context is needed to use it effectively.

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%, so the schema already documents all three parameters (url, count, startTime) with descriptions. The tool description adds no additional parameter semantics beyond what's in the schema, such as explaining regex usage for the url parameter or default behaviors for optional parameters. Baseline 3 is appropriate when the schema handles parameter documentation adequately.

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 ('获取' meaning 'get') and resource ('URL的拦截信息' meaning 'intercept information of URL'), specifying that both requests and responses are base64-encoded. It distinguishes itself from siblings like getRules or getWhistleStatus by focusing specifically on URL interception data rather than rules or system status.

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 is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, such as needing interception to be enabled (via toggleHttpInterception or toggleHttpsInterception), or differentiate it from other data retrieval tools like getRules or replayRequest. Usage context is implied but not stated.

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

Related 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/7gugu/whistle-mcp'

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