proxy_enable_rule
Enable a disabled network traffic interception rule to resume capturing, modifying, or mocking HTTP/HTTPS traffic through the proxy server.
Instructions
Enable a disabled interception rule.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rule_id | Yes | Rule ID to enable |
Implementation Reference
- src/state.ts:512-517 (handler)The `enableRule` method in `ProxyManager` updates the `enabled` state of the rule and triggers a rebuild of the mockttp server to apply the changes.
async enableRule(id: string): Promise<void> { const rule = this.rules.get(id); if (!rule) throw new Error(`Rule '${id}' not found`); rule.enabled = true; if (this._running) await this.rebuildMockttpRules(); } - src/tools/rules.ts:222-234 (handler)The tool handler for `proxy_enable_rule` which calls `proxyManager.enableRule`.
async ({ rule_id }) => { try { await proxyManager.enableRule(rule_id); return { content: [{ type: "text", text: JSON.stringify({ status: "success", message: `Rule '${rule_id}' enabled.` }), }], }; } catch (e) { return { content: [{ type: "text", text: JSON.stringify({ status: "error", error: String(e) }) }] }; } },