# query_rules

Read automation rules. action: all (list all), get (by UID).

Agent View of the PolicyLayer registry record for `query_rules`. HTML page: https://policylayer.com/tools/deswong-openhab-mcp/query-rules

## Facts

- Tool: `query_rules`
- Server: Openhab (`deswong/openhab-mcp`) — https://policylayer.com/tools/deswong-openhab-mcp.md
- Homepage: https://github.com/deswong/Openhab-MCP
- Risk category: Read (Low risk)
- Registry record: grade F, 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": "query_rules",
    "arguments": {}
  }
}
```

## Why query_rules is rated Low

This tool queries and lists automation rules without executing them, modifying them, or triggering any side effects. It is a read-only operation that retrieves rule metadata and configuration. The low severity reflects minimal risk even if misused by an AI agent, as viewing rule definitions poses no direct harm to the home automation system.

From the tool's own definition: "Tool description explicitly states 'Read automation rules' with actions 'all (list all), get (by UID)' — pure retrieval with no modification or execution of rules."

## Use case

AI agents call query_rules to retrieve information from Openhab 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 Openhab:

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

## Other tools on Openhab (24)

- `manage_item` — Destructive — https://policylayer.com/tools/deswong-openhab-mcp/manage-item.md
- `manage_rule` — Destructive — https://policylayer.com/tools/deswong-openhab-mcp/manage-rule.md
- `manage_thing` — Destructive — https://policylayer.com/tools/deswong-openhab-mcp/manage-thing.md
- `manage_ui` — Destructive — https://policylayer.com/tools/deswong-openhab-mcp/manage-ui.md
- `automation` — Execute — https://policylayer.com/tools/deswong-openhab-mcp/automation.md
- `control_media` — Execute — https://policylayer.com/tools/deswong-openhab-mcp/control-media.md
- `execute_batch` — Execute — https://policylayer.com/tools/deswong-openhab-mcp/execute-batch.md
- `manage_system` — Execute — https://policylayer.com/tools/deswong-openhab-mcp/manage-system.md
- `remediate` — Execute — https://policylayer.com/tools/deswong-openhab-mcp/remediate.md
- `schedule_command` — Execute — https://policylayer.com/tools/deswong-openhab-mcp/schedule-command.md
- `send_command` — Execute — https://policylayer.com/tools/deswong-openhab-mcp/send-command.md
- `analyze_home` — Read — https://policylayer.com/tools/deswong-openhab-mcp/analyze-home.md
- `diagnose_item` — Read — https://policylayer.com/tools/deswong-openhab-mcp/diagnose-item.md
- `generate_home_blueprint` — Read — https://policylayer.com/tools/deswong-openhab-mcp/generate-home-blueprint.md
- `get_system_summary` — Read — https://policylayer.com/tools/deswong-openhab-mcp/get-system-summary.md
- `initial_discovery` — Read — https://policylayer.com/tools/deswong-openhab-mcp/initial-discovery.md
- `manage_logs` — Read — https://policylayer.com/tools/deswong-openhab-mcp/manage-logs.md
- `mcp_status` — Read — https://policylayer.com/tools/deswong-openhab-mcp/mcp-status.md
- `query_items` — Read — https://policylayer.com/tools/deswong-openhab-mcp/query-items.md
- `query_things` — Read — https://policylayer.com/tools/deswong-openhab-mcp/query-things.md
- `resolve_item` — Read — https://policylayer.com/tools/deswong-openhab-mcp/resolve-item.md
- `manage_link` — Write — https://policylayer.com/tools/deswong-openhab-mcp/manage-link.md
- `manage_persistence` — Write — https://policylayer.com/tools/deswong-openhab-mcp/manage-persistence.md
- `manage_scene` — Write — https://policylayer.com/tools/deswong-openhab-mcp/manage-scene.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=deswong-openhab-mcp · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/deswong-openhab-mcp
