curl -X POST https://win.oneshotagent.com/v1/tools/watch \
-H "Content-Type: application/json" \
-H "X-Agent-ID: 0x..." \
-H "X-Agent-Proof: <signed proof>" \
-d '{
"source_tool": "web_read",
"input": {"url": "https://example.com/camps"},
"selection": {"text": "Summer camp"},
"every_minutes": 30,
"max_spend": 1
}'
{
"success": true,
"data": {
"id": "0c5e2f7a-3b1d-4e8a-9f60-1a2b3c4d5e6f",
"source": "tool",
"source_tool": "web_read",
"input": {"url": "https://example.com/camps"},
"selection": {"text": "Summer camp"},
"every_minutes": 30,
"checks": 0,
"delivery": "notification",
"status": "running",
"stop_reason": null,
"max_spend": 1,
"spent": 0
}
}
Monitoring
Tool watches
Run a read-only tool on a schedule and be told when its answer changes
POST
/
v1
/
tools
/
watch
curl -X POST https://win.oneshotagent.com/v1/tools/watch \
-H "Content-Type: application/json" \
-H "X-Agent-ID: 0x..." \
-H "X-Agent-Proof: <signed proof>" \
-d '{
"source_tool": "web_read",
"input": {"url": "https://example.com/camps"},
"selection": {"text": "Summer camp"},
"every_minutes": 30,
"max_spend": 1
}'
{
"success": true,
"data": {
"id": "0c5e2f7a-3b1d-4e8a-9f60-1a2b3c4d5e6f",
"source": "tool",
"source_tool": "web_read",
"input": {"url": "https://example.com/camps"},
"selection": {"text": "Summer camp"},
"every_minutes": 30,
"checks": 0,
"delivery": "notification",
"status": "running",
"stop_reason": null,
"max_spend": 1,
"spent": 0
}
}
A tool watch repeats a read-only call every
every_minutes. Its first answer is the baseline. Changed answers produce watch notifications and, with webhook_url, signed webhooks.
What can be watched
web_read: a page.selection.textwatches the paragraph, or the section under a heading, that holds the text.selection.regexwatches what the pattern matches (its groups when it has any). Without a selection, the whole page. At least every 5 minutes.- A lookup that answers at once. A lookup of one entity compares its fields;
selection.pathnarrows them. A search compares which results are listed. At least every 15 minutes, or longer when the source asks.
Charges
Each successful check costs the tool’s own price plus the check fee; each change also costs the change price (Pricing). A failed read is free.max_spend must cover a check and a possible change. A check runs only if credits and the remaining cap cover it plus a possible change; otherwise the watch pauses.
Five failed reads in a row stop the watch: status stopped, stop_reason unreadable. A stopped watch cannot be changed; delete it.
Changes
Page changes show changed lines inbefore and after; lookup changes have field, before and after. Search changes use field $list: before/after are full membership counts; added results and removed identities each contain at most ten entries, not the complete delta.
Goals
A goal pays from its budget and holds at most 5 watches; they stop when it ends or cannot pay. Changes sendwatch_changed only to a live session. Between recurring runs, no event fires and the baseline stays: a later check delivers a persisting change, but a reversion means no wake. An event count done check accepts watch_changed.
Create
source_tool (web_read or a lookup name), input (the tool’s input), selection, every_minutes (default: 15 or the source minimum, whichever is greater), max_spend and webhook_url. Leave out entity_type, attribute and key.
curl -X POST https://win.oneshotagent.com/v1/tools/watch \
-H "Content-Type: application/json" \
-H "X-Agent-ID: 0x..." \
-H "X-Agent-Proof: <signed proof>" \
-d '{
"source_tool": "web_read",
"input": {"url": "https://example.com/camps"},
"selection": {"text": "Summer camp"},
"every_minutes": 30,
"max_spend": 1
}'
{
"success": true,
"data": {
"id": "0c5e2f7a-3b1d-4e8a-9f60-1a2b3c4d5e6f",
"source": "tool",
"source_tool": "web_read",
"input": {"url": "https://example.com/camps"},
"selection": {"text": "Summer camp"},
"every_minutes": 30,
"checks": 0,
"delivery": "notification",
"status": "running",
"stop_reason": null,
"max_spend": 1,
"spent": 0
}
}