Skip to main content
Glama

getRules

Retrieve all rules and groupings from the Whistle MCP Server to manage proxy settings, monitor network requests, and streamline proxy server operations.

Instructions

获取所有规则&分组

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The execute handler for the 'getRules' MCP tool. It calls whistleClient.getRules() to fetch the rules and wraps the result using formatResponse.
    execute: async () => {
      const rules = await whistleClient.getRules();
      return formatResponse(rules);
    },
  • src/index.ts:33-41 (registration)
    Registration of the 'getRules' tool using FastMCP server's addTool method, including name, description, empty input schema, and inline handler.
    server.addTool({
      name: "getRules",
      description: "获取所有规则&分组",
      parameters: z.object({}),
      execute: async () => {
        const rules = await whistleClient.getRules();
        return formatResponse(rules);
      },
    });
  • Zod schema for input parameters of getRules tool (empty object, no parameters required).
    parameters: z.object({}),
  • Core helper method in WhistleClient that performs the HTTP GET request to Whistle's /cgi-bin/rules/list endpoint to retrieve all rules and groups.
    async getRules(): Promise<any> {
      const response = await axios.get(`${this.baseUrl}/cgi-bin/rules/list`);
      return response.data;
    }
  • Utility function used by all tools to format responses in MCP-compatible structure with JSON-stringified data.
    function formatResponse(data: any) {
      return {
        content: [
          {
            type: "text" as const,
            text: JSON.stringify(data),
          },
        ],
      };
    }
Behavior1/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. The description only states what the tool does ('get all rules & groups') without any information about permissions, rate limits, side effects, or response format. This leaves critical behavioral traits undocumented, making it inadequate for safe and effective use.

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 extremely concise—a single phrase in Chinese that directly states the tool's purpose without any fluff. It's front-loaded with the core action and resources, making it efficient and easy to parse. Every word earns its place by conveying essential information.

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 lack of annotations and output schema, the description is incomplete. It doesn't explain what 'all rules & groups' entails (e.g., format, structure, or scope), nor does it address behavioral aspects like read-only nature or potential errors. For a tool in a complex system with many siblings, more context is needed to ensure proper 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 appropriately doesn't discuss parameters, as there are none. This meets the baseline for tools with no parameters, as the schema fully covers the absence of inputs.

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 '获取所有规则&分组' (Get all rules & groups) clearly states the verb ('get') and resources ('rules' and 'groups'), making the purpose unambiguous. It distinguishes from siblings like 'getAllValues' or 'getInterceptInfo' by specifying the exact resources. However, it doesn't explicitly mention that it retrieves both rules and groups together, which could be slightly more specific.

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. It doesn't mention prerequisites, context for usage, or differentiate from similar tools like 'getAllValues' or 'getInterceptInfo'. The agent must infer usage based on the name alone, which is insufficient for optimal tool selection.

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