Skip to content

Commit 1bced8d

Browse files
committed
fix(tools): starting a provider query or job is a write; operations of unregistered tools count as write
1 parent 353612e commit 1bced8d

11 files changed

Lines changed: 19 additions & 18 deletions

File tree

‎.agents/skills/add-integration/SKILL.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ resources. A real external/browser route and an in-process tool may share the sa
191191
neither calls the other. Follow the full transport and handler rules in the `add-tools` skill.
192192

193193
Every tool declares `effect: 'read' | 'write'`, classified from the API docs you researched in Step 1
194-
by the rules in `add-tools` → Declaring the effect; `bun run check:tool-effects` enforces them.
194+
by the rules in `add-tools` → Declaring the effect. `bun run check:tool-effects` checks only that the
195+
label agrees with the HTTP method (or carries a `// tool-effect:` reason); classifying POST and
196+
in-process operations is on you.
195197

196198
**types.ts:**
197199
```typescript

‎.agents/skills/add-tools/SKILL.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export const {serviceName}{Action}Tool: InternalToolConfig<
165165
name: '{Service} {Action}',
166166
description: 'Brief description',
167167
version: '1.0.0',
168-
effect: 'read',
168+
effect: 'write', // `read` only once you have verified the operation changes nothing outside Sim
169169
params: {
170170
// Same canonical metadata as an external tool.
171171
},
@@ -194,8 +194,8 @@ Labelling a write `read` is the one unsafe mistake, so classify from the provide
194194
semantics, never the name alone.
195195

196196
`read` means the call changes nothing outside Sim: no create, update, delete, send, post, trigger,
197-
enqueue, consume, or mark-read; no job, run, conversation, history item, or other resource left in
198-
an account; no contact data revealed for credits; no external delivery. Usage billing for the call
197+
enqueue, consume, or mark-read; starts no provider job or query, even a short-lived one; leaves no
198+
run, conversation, history item, or other resource in an account; no contact data revealed for credits; no external delivery. Usage billing for the call
199199
itself does not count. `write` is anything else.
200200

201201
**Contact reveals:** revealing a person's contact data (email, phone) for credits is `write`: an

‎apps/docs/openapi-v2-resources.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21950,7 +21950,7 @@
2195021950
"effect": {
2195121951
"type": "string",
2195221952
"enum": ["read", "write"],
21953-
"description": "What running the tool does outside Sim. `read` changes nothing there: no create, update, delete, send, post, trigger, enqueue, consume, or mark-read; no job, run, conversation, history item, or other resource left in an account; no contact data revealed for credits; no external delivery. Usage billing for the call itself does not count. `write` is anything else, including an effect that depends on the input. Revealing a person's contact data (email, phone) for credits is `write`; company/firmographic lookups and verifications that only spend lookup credits are `read`."
21953+
"description": "What running the tool does outside Sim. `read` changes nothing there: no create, update, delete, send, post, trigger, enqueue, consume, or mark-read; no provider job or query started, even a short-lived one; no run, conversation, history item, or other resource left in an account; no contact data revealed for credits; no external delivery. Usage billing for the call itself does not count. `write` is anything else, including an effect that depends on the input. Revealing a person's contact data (email, phone) for credits is `write`; company/firmographic lookups and verifications that only spend lookup credits are `read`."
2195421954
},
2195521955
"hostedApiKey": {
2195621956
"type": "string",
@@ -22676,7 +22676,7 @@
2267622676
"effect": {
2267722677
"type": "string",
2267822678
"enum": ["read", "write"],
22679-
"description": "What running the tool does outside Sim. `read` changes nothing there: no create, update, delete, send, post, trigger, enqueue, consume, or mark-read; no job, run, conversation, history item, or other resource left in an account; no contact data revealed for credits; no external delivery. Usage billing for the call itself does not count. `write` is anything else, including an effect that depends on the input. Revealing a person's contact data (email, phone) for credits is `write`; company/firmographic lookups and verifications that only spend lookup credits are `read`."
22679+
"description": "What running the tool does outside Sim. `read` changes nothing there: no create, update, delete, send, post, trigger, enqueue, consume, or mark-read; no provider job or query started, even a short-lived one; no run, conversation, history item, or other resource left in an account; no contact data revealed for credits; no external delivery. Usage billing for the call itself does not count. `write` is anything else, including an effect that depends on the input. Revealing a person's contact data (email, phone) for credits is `write`; company/firmographic lookups and verifications that only spend lookup credits are `read`."
2268022680
},
2268122681
"hostedApiKey": {
2268222682
"type": "string",
@@ -32969,7 +32969,7 @@
3296932969
"additionalProperties": {
3297032970
"type": "string",
3297132971
"enum": ["read", "write"],
32972-
"description": "What running the tool does outside Sim. `read` changes nothing there: no create, update, delete, send, post, trigger, enqueue, consume, or mark-read; no job, run, conversation, history item, or other resource left in an account; no contact data revealed for credits; no external delivery. Usage billing for the call itself does not count. `write` is anything else, including an effect that depends on the input. Revealing a person's contact data (email, phone) for credits is `write`; company/firmographic lookups and verifications that only spend lookup credits are `read`."
32972+
"description": "What running the tool does outside Sim. `read` changes nothing there: no create, update, delete, send, post, trigger, enqueue, consume, or mark-read; no provider job or query started, even a short-lived one; no run, conversation, history item, or other resource left in an account; no contact data revealed for credits; no external delivery. Usage billing for the call itself does not count. `write` is anything else, including an effect that depends on the input. Revealing a person's contact data (email, phone) for credits is `write`; company/firmographic lookups and verifications that only spend lookup credits are `read`."
3297332973
}
3297432974
},
3297532975
"dynamicOutputs": {

‎apps/sim/lib/api/contracts/v2/catalog.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ const v2HostedApiKeySchema = z
414414
export const v2ToolEffectSchema = z
415415
.enum(['read', 'write'])
416416
.describe(
417-
"What running the tool does outside Sim. `read` changes nothing there: no create, update, delete, send, post, trigger, enqueue, consume, or mark-read; no job, run, conversation, history item, or other resource left in an account; no contact data revealed for credits; no external delivery. Usage billing for the call itself does not count. `write` is anything else, including an effect that depends on the input. Revealing a person's contact data (email, phone) for credits is `write`; company/firmographic lookups and verifications that only spend lookup credits are `read`."
417+
"What running the tool does outside Sim. `read` changes nothing there: no create, update, delete, send, post, trigger, enqueue, consume, or mark-read; no provider job or query started, even a short-lived one; no run, conversation, history item, or other resource left in an account; no contact data revealed for credits; no external delivery. Usage billing for the call itself does not count. `write` is anything else, including an effect that depends on the input. Revealing a person's contact data (email, phone) for credits is `write`; company/firmographic lookups and verifications that only spend lookup credits are `read`."
418418
)
419419

420420
const v2ToolOAuthSchema = z.object({

‎apps/sim/lib/catalog/projection/block-detail.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -518,10 +518,8 @@ export function projectBlockDetail(
518518
inputs,
519519
outputs: tool?.outputs ?? {},
520520
inputSchema: operationFields[operationId] ?? [],
521-
...(toolId !== undefined ? { toolId } : {}),
522-
...(tool
523-
? { toolName: tool.name, effect: tool.effect, description: describeTool(tool) }
524-
: {}),
521+
...(toolId !== undefined ? { toolId, effect: tool?.effect ?? 'write' } : {}),
522+
...(tool ? { toolName: tool.name, description: describeTool(tool) } : {}),
525523
}
526524
}
527525

‎apps/sim/tools/brightdata/discover.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const brightDataDiscoverTool: ToolConfig<
2323
description:
2424
'AI-powered web discovery that finds and ranks results by intent. Returns up to 20 results with optional cleaned page content for RAG and verification.',
2525
version: '1.0.0',
26-
effect: 'read',
26+
effect: 'write',
2727
oauth: BRIGHTDATA_CREDENTIAL_OAUTH,
2828

2929
params: {

‎apps/sim/tools/cloudwatch/query_logs.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const queryLogsTool: InternalToolConfig<
1313
name: 'CloudWatch Query Logs',
1414
description: 'Run a CloudWatch Log Insights query against one or more log groups',
1515
version: '1.0.0',
16-
effect: 'read',
16+
effect: 'write',
1717
oauth: AWS_CREDENTIAL_OAUTH,
1818

1919
params: {

‎apps/sim/tools/generated/tool-metadata.ts‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎apps/sim/tools/textract/analyze-expense.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const textractAnalyzeExpenseTool: InternalToolConfig<
6868
name: 'AWS Textract Analyze Expense',
6969
description: 'Extract structured invoice and receipt fields using AWS Textract AnalyzeExpense',
7070
version: '1.0.0',
71-
effect: 'read',
71+
effect: 'write',
7272
oauth: AWS_CREDENTIAL_OAUTH,
7373

7474
params: {

‎apps/sim/tools/textract/parser.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const textractParserTool: InternalToolConfig<TextractParserInput, Textrac
3636
name: 'AWS Textract Parser',
3737
description: 'Parse documents using AWS Textract OCR and document analysis',
3838
version: '1.0.0',
39-
effect: 'read',
39+
effect: 'write',
4040
oauth: AWS_CREDENTIAL_OAUTH,
4141

4242
params: {

0 commit comments

Comments
 (0)