Dive

Tool file

Tool file

One user tool, in `./.dive/tools/` or `~/.config/dive/tools/`, called as `user__<name>`. A file in a tools directory's `builtin/` subdirectory replaces the built-in tool it names instead.

File typeLocation
YAML./.dive/tools/<name>.yaml (project)
~/.config/dive/tools/<name>.yaml (global)
<tools dir>/builtin/<name>.yaml (replaces a built-in tool)

Unknown keys are a load error. For completion in your editor, start the file with # yaml-language-server: $schema=https://raw.githubusercontent.com/loon-rocks/dive/main/docs/schemas/tool.schema.json.

Common fields

versioninteger

The file version the document is written in. Omitted means 1; dive tool migrate brings a file to the current version.

namestringrequired

Letters, digits, _ and -. The tool is called as user__<name>.

descriptionstringrequired

What the tool does and returns. Agents and the plan drafter read it when choosing tools.

kindenum<string>required

What the tool runs. Each kind takes its own fields, listed below.

Available options: exec, http, prompt, reshape, decision, image

JSON Schema for the input, validated before the tool runs. Templates reference it as {{input.<field>}}.

JSON Schema for the output. A prompt tool enforces it as structured output; for every kind it tells drafters what the tool returns.

read_onlyboolean

Marks the tool as free of side effects. reshape and decision tools are read-only by default, and so is an http tool whose method is GET.

generatedstring

The generator that wrote this file, such as dive-go. Set by the generator, never by hand. The desktop app and the drafters show a generated tool but don't edit or overwrite it; change it in the code it's generated from, then regenerate.

Kinds

Each kind adds its own fields.

  • exec: Runs a command.
  • http: Makes one HTTP request per call and returns the response body.
  • prompt: One model call.
  • reshape: Builds a value in a new JSON shape from the input, with no process and no model call.
  • image: Generates images with an image model and stores them as files.
  • decision: Asks a decision model typed questions about the same state, each answered independently.
version: 3
name: open_prs
description: Open pull requests in the current repository, newest first.
kind: exec
command: gh
args:
- pr
- list
- --state
- open
- --json
- number,title,author
- --limit
- '{{input.limit}}'
read_only: true
input_schema:
  type: object
  required:
  - limit
  properties:
    limit:
      type: integer
      description: Most pull requests to return