Dive

Guides

Create a tool in the workbench

Describe a tool, answer the architect's questions, and save the tool its builder drafts and test-runs.

merged_prs lists the pull requests merged since a date by running the gh CLI.

name: merged_prs
description: Pull requests merged into this repository since a date, as number, title and merge time.
kind: exec
command: gh
args:
  - pr
  - list
  - --state
  - merged
  - --search
  - "merged:>={{input.since}}"
  - --json
  - number,title,mergedAt
read_only: true
input_schema:
  type: object
  required: [since]
  properties:
    since:
      type: string
      description: The earliest merge date, as YYYY-MM-DD

Open the workbench in tool mode

dive workbench tool

Describe the tool

Say what goes in and what comes back. The drafting architect checks your catalog for a tool that already does it, then asks what it can't settle, one question at a time, each with its guess and how confident it is.

The workbench with network_drafter active: the request on the left and the architect's read of it, 70% confident, asking whether the tool should take a repository or use the one Dive runs in, guessing the latter.
The architect's question, with its guess and its confidence.

Confirm and build it

Once it can predict your answers, the architect restates what it'll build, including what's out of scope, and sketches the tool in the workspace. Say yes, then tell it to build. The tool drafter writes the file and test-runs it on a sample input once you approve the run:

The workbench's approval form asking whether to test-run user__merged_prs once with the command gh pr list --state merged --search merged:>={{input.since}} --json number,title,mergedAt and the input since 2026-09-24, with run set to true.
The approval form for a test run, showing the command and the sample input.

The result shows in the workspace:

[
  {
    "mergedAt": "2026-10-09T02:25:01Z",
    "number": 147,
    "title": "feat!: plans state how they finish with a required finish key…"
  },
  …
]

Set the secrets it needs

A tool that needs a secret, such as an API token, reads it from env as ${NAME}, and the drafter adds a description saying what the value is and where to get it:

env:
  HUBSPOT_TOKEN:
    value: "${HUBSPOT_TOKEN}"
    description: "HubSpot private app token with `crm.objects.contacts.read`. Create one under [Settings › Private apps](https://app.hubspot.com/private-apps)."

A test never runs while one of these is unset. The architect lists what's missing, with each description, and waits. Store each value with dive secret set NAME (add --project to keep it to this project), say they're set, and it runs the test again. Say you'd rather skip testing and it offers to save the tool untested.

Save

Press Ctrl+S. Dive writes the file to ./.dive/tools/merged_prs.yaml, and the tool is in your catalog as user__merged_prs.