register_agent_tool
Register a new tool for the local model to call during agent runs, supporting shell executables and JavaScript functions, with optional persistence across restarts.
Instructions
Register a NEW tool that the local model can call during run_local_agent (persists for this server session; persist=true saves it across restarts). kind='shell': an executable + argv template with ${param} placeholders (execFile, no shell). kind='js': a JS function body run in node:vm as (body)(args). Requires LOCAL_LLM_DYNAMIC_TOOLS=1 on the server.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | js kind: function source, e.g. '(args) => args.a + args.b' | |
| kind | Yes | ||
| name | Yes | Tool name, ^[a-zA-Z0-9_-]{1,64}$ | |
| command | No | shell kind: executable name/path | |
| persist | No | Save to dynamic_tools.json so it survives restarts | |
| description | Yes | What it does — the local model picks tools by this text | |
| input_schema | Yes | JSON Schema object for the parameters (type:'object', properties, required) | |
| args_template | No | shell kind: argv template, e.g. ["--format", "${fmt}", "${input}"] |