Tool
Tools are a type of entry point for an extension. As opposed to a command, they don’t show up in the root search and the user can’t directly interact with them. Instead, they are functionalities that the AI can use to interact with an extension.
Types
Tool.Confirmation
A tool confirmation is used to ask the user to validate the side-effects of the tool.
The tool confirmation is executed before the actual tool is executed and receives the same input as the tool. A confirmation returns an optional object that describes what the tool is about to do. It is important to be as clear as possible.
If the user confirms the action, the tool will be executed afterwards. If the user cancels the action, the tool will not be executed.
You can return undefined
to skip the confirmation. This is useful for tools that conditionally perform destructive actions. F.e. when moving a file, you don't need to confirm the action if the file doesn't overwrite another file.
Example
Last updated