Dynamic Hook
dynamic_hookIntercept and modify network requests per browser tab using substring URL matching, with actions to block, fulfill with custom status/body/headers, or continue.
Instructions
Network rule (legacy thin wrapper around route_add). action='block'/'fulfill'/'continue'.
url_pattern=substring match. Tab-scoped. For richer matching/modify/HAR use route_add.
Ex: dynamic_hook('t0', '/api/items', 'fulfill', new_status=200, new_body='{"items":[]}')
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"tab_id": "<tab_id>",
"url_pattern": "<url_pattern>",
"action": "<action>"
},
"name": "dynamic_hook"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | ||
| tab_id | Yes | ||
| new_body | No | ||
| new_status | No | ||
| new_headers | No | ||
| url_pattern | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||