Build a tool
This tutorial adds a
greet tool to the Web UI. Complete Your first plugin first and keep its scratch-plugin directory.Create the tool plugin
Replace scratch-plugin/src/my-plugin.ts with:
inject makes Cordis wait for the tool registry. defineTool infers and validates args from parameters; execute returns the canonical value declared by output.schema, and output.render converts that value to model-facing content.
Run and call the tool
Restart the development command if it is not running:
Open the launch URL printed in the terminal, including its authentication fragment, and ask: Use the greet tool to greet Ada. The model can call greet and receives Hello, Ada! as the tool result.
Next steps
- Plugin configuration — make the greeting configurable.
- Tool authoring reference — look up nested schemas, canonical values, background work, policy hooks, PTC mode, and UI cards.
- Capability layering — split a replaceable capability into Service Definition, Service Provider, and Consumer packages.