Skip to content

Commit 53809d6

Browse files
committed
Update tools.mdx
1 parent 48c6ae0 commit 53809d6

1 file changed

Lines changed: 28 additions & 5 deletions

File tree

content/docs/extensions/tools.mdx

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,38 @@ ctx.register_tool(
5757
"tz_name": {
5858
"type": "string",
5959
"description": "timezone name (e.g. 'America/New_York')",
60-
"default": "UTC"
60+
"default": "UTC",
6161
}
6262
},
63-
"required": []
64-
}
65-
}
66-
})
63+
"required": [],
64+
},
65+
},
66+
},
67+
)
68+
69+
ctx.register_tool(
70+
edit_file,
71+
{
72+
"type": "function",
73+
"function": {
74+
"name": "edit_file",
75+
"description": "Replaces first occurrence of old_str with new_str in file. If old_str is empty, create/overwrite file with new_str.",
76+
"parameters": {
77+
"type": "object",
78+
"properties": {
79+
"path": {"type": "string", "description": "Path to the file to edit."},
80+
"old_str": {"type": "string", "description": "String to replace."},
81+
"new_str": {"type": "string", "description": "String to replace with."},
82+
},
83+
"required": ["path", "old_str", "new_str"],
84+
},
85+
},
86+
},
87+
)
6788
```
6889

90+
91+
6992
## UI Management
7093

7194
**Dedicated Tools Page**

0 commit comments

Comments
 (0)