Skip to main content
Glama

add_rules

Insert Clash routing rules at the start of an override file's +rules section so they take priority over general suffix rules, with automatic deduplication.

Instructions

向 override 文件的 +rules: 段最前面插入规则(先于通用后缀规则生效),自动去重。rules 为 clash 规则字符串数组。override_file 可选,默认第一个可用 override。

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "rules": "<rules>"
    },
    "name": "add_rules"
  }
}

Input Schema

NameRequiredDescriptionDefault
rulesYes
override_fileNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It usefully discloses that rules are inserted at the front, that deduplication is automatic, and that the override file defaults to the first available one, but it omits persistence behavior, error handling, and whether the change takes effect immediately or requires reload_config.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two dense sentences with no filler, and the key insertion-position semantics are front-loaded. Slightly terse but every clause carries information.

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?

For a mutation tool with no annotations and no output schema, the description covers the core mechanics but leaves gaps around post-write behavior (reload requirement), failure modes, and what the tool returns, which an agent would need to call it confidently.

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?

Schema description coverage is 0%, so the description must compensate, and it does: it defines rules as an array of clash rule strings and explains that override_file is optional and defaults to the first available override. Both parameters gain meaning beyond the bare schema types.

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 names a specific verb and resource: inserting rules into the +rules: section of an override file, and it even specifies the insertion position (front, before general suffix rules). It is clearly distinguishable from siblings like list_rules or reload_config, though it does not explicitly name an alternative.

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

Usage Guidelines3/5

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

It implies when the tool applies by explaining the insertion position and the default override file, but it gives no explicit when-to-use or when-not-to-use guidance, and it does not mention whether a reload is needed afterward (a sibling reload_config exists).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.