proxy_update_rule
Modify HTTP/HTTPS interception rules to capture, mock, or transform network traffic by updating matchers, handlers, and priorities.
Instructions
Modify an existing interception rule.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rule_id | Yes | Rule ID to update | |
| description | No | New description | |
| priority | No | New priority | |
| matcher | No | New matcher config | |
| handler | No | New handler config |
Implementation Reference
- src/tools/rules.ts:82-111 (handler)The handler implementation for the `proxy_update_rule` tool, which calls `proxyManager.updateRule`.
server.tool( "proxy_update_rule", "Modify an existing interception rule.", { rule_id: z.string().describe("Rule ID to update"), description: z.string().optional().describe("New description"), priority: z.number().optional().describe("New priority"), matcher: matcherSchema.optional().describe("New matcher config"), handler: handlerSchema.optional().describe("New handler config"), }, async ({ rule_id, description, priority, matcher, handler }) => { try { const updates: Record<string, unknown> = {}; if (description !== undefined) updates.description = description; if (priority !== undefined) updates.priority = priority; if (matcher !== undefined) updates.matcher = matcher; if (handler !== undefined) updates.handler = handler; const rule = await proxyManager.updateRule(rule_id, updates); return { content: [{ type: "text", text: JSON.stringify({ status: "success", rule }), }], }; } catch (e) { return { content: [{ type: "text", text: JSON.stringify({ status: "error", error: String(e) }) }] }; } }, );