Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/enapter_mcp_server/mcp/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@


class Server(enapter.async_.Routine):

def __init__(
self,
app: core.ApplicationServer,
Expand Down Expand Up @@ -507,11 +506,13 @@ async def edit_rule(

The updated `Rule` object is returned. Use `read_rule` if you need to inspect the resulting source code.

Before proposing an edit, check the rule's status via `read_rule` — if it is enabled, tell the user to disable it in the Enapter UI first rather than attempting the edit.

Required skills:
- `enapter:rule-creator`: Explains how to create rules in detail. You MUST have it loaded before touching any rule code.

Related tools:
- `read_rule`: Inspect the current script before crafting an edit.
- `read_rule`: Inspect the current script and status before crafting an edit.
- `create_rule`: Create a new MCP-managed rule.
- `delete_rule`: Remove the rule.
- `read_skill`: Load the `enapter:rule-creator` skill documentation.
Expand All @@ -536,7 +537,10 @@ async def delete_rule(

The rule must be disabled and its slug must start with `mcp-`. The tool returns no result; confirm deletion via `search_rules`.

Before proposing a deletion, check the rule's status via `read_rule` — if it is enabled, tell the user to disable it in the Enapter UI first rather than attempting the deletion.

Related tools:
- `read_rule`: Inspect the rule's status before deleting.
- `search_rules`: Verify the rule no longer exists after deletion.
- `create_rule`: Re-create the rule if needed.
"""
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/schemas/delete_rule.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"readOnlyHint": false,
"title": "Delete Rule"
},
"description": "Delete a disabled MCP-managed automation rule.\n\nThe rule must be disabled and its slug must start with `mcp-`. The tool returns no result; confirm deletion via `search_rules`.\n\nRelated tools:\n- `search_rules`: Verify the rule no longer exists after deletion.\n- `create_rule`: Re-create the rule if needed.",
"description": "Delete a disabled MCP-managed automation rule.\n\nThe rule must be disabled and its slug must start with `mcp-`. The tool returns no result; confirm deletion via `search_rules`.\n\nBefore proposing a deletion, check the rule's status via `read_rule` — if it is enabled, tell the user to disable it in the Enapter UI first rather than attempting the deletion.\n\nRelated tools:\n- `read_rule`: Inspect the rule's status before deleting.\n- `search_rules`: Verify the rule no longer exists after deletion.\n- `create_rule`: Re-create the rule if needed.",
"execution": null,
"icons": null,
"inputSchema": {
Expand All @@ -33,4 +33,4 @@
"name": "delete_rule",
"outputSchema": null,
"title": "Delete Rule"
}
}
4 changes: 2 additions & 2 deletions tests/integration/schemas/edit_rule.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"readOnlyHint": false,
"title": "Edit Rule"
},
"description": "Apply a content-match edit to a disabled MCP-managed rule's script.\n\nThis tool replaces exactly one occurrence of `old_string` with `new_string` in the rule's current Lua script. The rule must be disabled, its slug must start with `mcp-`, and it must use runtime version v3.\n\n`old_string` must be non-empty, must appear exactly once in the current script, and must differ from `new_string`.\n\nThe updated `Rule` object is returned. Use `read_rule` if you need to inspect the resulting source code.\n\nRequired skills:\n- `enapter:rule-creator`: Explains how to create rules in detail. You MUST have it loaded before touching any rule code.\n\nRelated tools:\n- `read_rule`: Inspect the current script before crafting an edit.\n- `create_rule`: Create a new MCP-managed rule.\n- `delete_rule`: Remove the rule.\n- `read_skill`: Load the `enapter:rule-creator` skill documentation.",
"description": "Apply a content-match edit to a disabled MCP-managed rule's script.\n\nThis tool replaces exactly one occurrence of `old_string` with `new_string` in the rule's current Lua script. The rule must be disabled, its slug must start with `mcp-`, and it must use runtime version v3.\n\n`old_string` must be non-empty, must appear exactly once in the current script, and must differ from `new_string`.\n\nThe updated `Rule` object is returned. Use `read_rule` if you need to inspect the resulting source code.\n\nBefore proposing an edit, check the rule's status via `read_rule` — if it is enabled, tell the user to disable it in the Enapter UI first rather than attempting the edit.\n\nRequired skills:\n- `enapter:rule-creator`: Explains how to create rules in detail. You MUST have it loaded before touching any rule code.\n\nRelated tools:\n- `read_rule`: Inspect the current script and status before crafting an edit.\n- `create_rule`: Create a new MCP-managed rule.\n- `delete_rule`: Remove the rule.\n- `read_skill`: Load the `enapter:rule-creator` skill documentation.",
"execution": null,
"icons": null,
"inputSchema": {
Expand Down Expand Up @@ -100,4 +100,4 @@
"type": "object"
},
"title": "Edit Rule"
}
}
Loading