Skip to main content
Glama
huaqing0
by huaqing0

clash.optimize.rules

Diagnoses Clash rules configuration by detecting duplicates, invalid proxy references, MATCH position issues, rule shadowing, and rule count. Returns a report with findings and proposed actions.

Instructions

v1.0-B: Read-only rules configuration diagnosis. Checks duplicate rules, invalid proxy references, MATCH position, rule shadowing, and rule count. Returns a versioned report with findings and proposedActions. Does NOT modify rules. Static order analysis cannot prove real traffic hits; runtime verification is required.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations provided, the description fully covers behavioral traits: it is read-only, performs specific checks, returns a versioned report with findings and proposedActions, and does not modify rules. It also clearly states a limitation (static order analysis cannot prove real traffic hits), providing honest expectations.

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 concise but packed with essential information: version label, purpose, list of checks, output type, and a key limitation. Every sentence adds value, and the most important information (read-only, diagnosis) is front-loaded.

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

Completeness4/5

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

Given the tool's simplicity (no parameters, no output schema in structured data), the description covers what it does and its limitations. It mentions the report contains 'findings and proposedActions,' which gives an idea of the output. It could be slightly more detailed on the report structure, but it is adequate for an agent to understand when to use it.

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 tool has zero parameters, so no parameter information is needed. The description adds meaning by explaining the tool's function and what it diagnoses, which is sufficient. Baseline for 0 params is 4.

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 it is a read-only rules configuration diagnosis tool. It lists specific checks: duplicate rules, invalid proxy references, MATCH position, rule shadowing, and rule count. It distinguishes itself from sibling modification tools by emphasizing it does NOT modify rules, and from other diagnosis tools by focusing on rules specifically.

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

Usage Guidelines4/5

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

The description explicitly states the tool is for diagnosis and does not modify rules, indicating when to use it. It also notes the limitation that static analysis cannot prove real traffic hits, suggesting complementary use with runtime verification. However, it does not explicitly differentiate from siblings like clash.rules.inspect or other optimize tools, but the context is clear enough.

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/huaqing0/clash-control-mcp'

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