Turn something you just worked out into a reusable tool
procedure_saveTurns a verified browser task into a parameterized, reusable callable tool so future agents invoke it instead of repeating the work.
Instructions
Promote a task you have just completed into a callable tool, so the next agent invokes it instead of working it out again. This is the highest-leverage thing you can leave behind: a lesson still has to be read and applied, a procedure is simply called.
Save one only when you have actually run the code and seen it work in this session.
Parameterize it. If you fetched metrics for one VPS over one time window, the procedure takes (vpsId, hours) — hardcoding the values you happened to use is the single most common way this goes wrong and produces a tool nobody can reuse.
The code runs in the page via evaluate, with your parameters available as params. It must return a value. It is checked against origin before running, so it cannot fire on the wrong site. Mark mutating: true for anything that creates, changes or deletes — those refuse to run without explicit confirmation, and should be rare.
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": {
"url": "<url>",
"name": "<name>",
"description": "<description>",
"origin": "<origin>",
"code": "<code>"
},
"name": "procedure_save"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The site this belongs to. | |
| code | Yes | JS body with `params` in scope. Must return a value. No secrets — they are stripped. | |
| name | Yes | Tool name: lowercase with underscores, descriptive, globally unique. e.g. "examplehost_list_vps". | |
| origin | Yes | Exact origin it must run on, e.g. "https://panel.examplehost.com". | |
| params | No | The parameters it accepts. | |
| expects | No | Shape of a successful result, so a wrong answer is recognizable. | |
| mutating | No | True if it changes state on the site. Defaults to false. | |
| description | Yes | What it does, for an agent deciding whether to call it. |