# waf_rule_stats

返回当前已加载规则的统计：含 rules_file、compiled_rules、compile_failed、compile_errors（截断）及分类计数。

Agent View of the PolicyLayer registry record for `waf_rule_stats`. HTML page: https://policylayer.com/tools/12211725-star-hospital-waf-mcp/waf-rule-stats

## Facts

- Tool: `waf_rule_stats`
- Server: Hospital WAF MCP (`12211725-star/hospital-waf-mcp`) — https://policylayer.com/tools/12211725-star-hospital-waf-mcp.md
- Homepage: https://github.com/12211725-star/hospital-waf-mcp
- Risk category: Read (Low risk)
- Registry record: grade C, identity unverified
- Server rate-limited: no
- Parameters: 0
- Recommended policy verdict: Allowed

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "waf_rule_stats",
    "arguments": {}
  }
}
```

## Why waf_rule_stats is rated Low

This tool retrieves and reports metadata about the WAF's rule engine state (compilation status, rule counts, error summaries). It performs no side effects—no rules are created, modified, deleted, or executed. It is a purely informational read operation with minimal security impact if misused.

From the tool's own definition: "Tool name 'waf_rule_stats' and description state it 'returns statistics of currently loaded rules' including rule file paths, compiled rule counts, failure counts, and categorized counts."

## Use case

AI agents call waf_rule_stats to retrieve information from Hospital WAF MCP without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.

## Recommended policy (PolicyLayer)

Verdict: **Allowed**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Hospital WAF MCP:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "waf_rule_stats": {}
  }
}
```

## Other tools on Hospital WAF MCP (3)

- `waf_run_self_tests` — Execute — https://policylayer.com/tools/12211725-star-hospital-waf-mcp/waf-run-self-tests.md
- `waf_check_request` — Read — https://policylayer.com/tools/12211725-star-hospital-waf-mcp/waf-check-request.md
- `waf_reload_rules` — Read — https://policylayer.com/tools/12211725-star-hospital-waf-mcp/waf-reload-rules.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=12211725-star-hospital-waf-mcp · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/12211725-star-hospital-waf-mcp
