Chat tools: argument validation, replace, file snapshots, server-fetched images, show_run, show_diff head/paths, schedule_followup

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-02 19:44:47 +00:00
parent c441400f36
commit d204ce3187
27 changed files with 1988 additions and 79 deletions
+19 -8
View File
@@ -5,21 +5,32 @@ the Pipelines app (desktop, web or phone), often not at this machine's terminal.
## Pipelines tools (`pipelines` MCP server)
Each call adds a persisted item to the transcript and returns one short line; a
refusal comes back as an error with the reason. Paths must resolve inside the
operator's home (absolute, `~/...`, or relative to the chat's directory).
Each `show_*` call adds a persisted item to the transcript and returns one short
line ending with the item's id; a refusal comes back as an error with the
reason. Arguments are checked against the tool's schema: an unknown or
misnamed field is refused with the list of expected fields. Paths must resolve
inside the operator's home (absolute, `~/...`, or relative to the chat's
directory).
Every `show_*` tool takes `replace?`: the id of an item this chat showed
earlier, of the same kind (file and image count as one). The card is updated
where it is instead of a new one being added; use it for a chart or diff you
regenerate, or a file you rewrote.
| Tool | Arguments | Use for |
| --- | --- | --- |
| `show_file` | `path`, `title?` | Any file the operator should see: images inline, other files as a preview card. Use instead of naming a path. |
| `show_image` | `url_or_path`, `title?`, `alt?` | A home `image/*` file or an `https://` URL (no credentials, at most 2048 chars). |
| `show_html` | `html`, `title?`, `height_hint?` (120-600) | Self-contained HTML/SVG: diagrams, charts, tables. Sandboxed: no JavaScript, no network; inline CSS/SVG, `<details>`, `:hover`. Refused above 512 KiB. |
| `show_diff` | `path?`, `base?`, `committed_only?`, `title?` | A Git diff card when the operator asks to see the changes, or before submitting a pull request. No `base`: uncommitted work (staged, unstaged, untracked) against HEAD. `base` (e.g. `main`): everything since the merge base, which is what a PR contains, plus uncommitted work unless `committed_only`. Pipelines runs Git; do not paste the diff. |
| `show_file` | `path`, `title?`, `replace?` | Any file the operator should see: images inline, other files as a preview card. Use instead of naming a path. A file up to 5 MiB is copied when shown, so the card keeps that version; a larger one stays linked and its card says "changed since shown" or "no longer exists". |
| `show_image` | `url_or_path`, `title?`, `alt?`, `replace?` | A home `image/*` file, or an `https://` URL that Pipelines downloads and keeps (public hosts only, PNG/JPEG/GIF/WebP/AVIF/BMP, at most 10 MiB, no credentials, no redirect to plain http). A failed download is an error and nothing is shown. |
| `show_html` | `html`, `title?`, `height_hint?` (120-600), `replace?` | Self-contained HTML/SVG: diagrams, charts, tables. Sandboxed: no JavaScript, no network; inline CSS/SVG, `<details>`, `:hover`. Follows the operator's light/dark theme: style both with `@media (prefers-color-scheme: dark)` or `Canvas`/`CanvasText`, or set your own background and text colours. Refused above 512 KiB. |
| `show_diff` | `path?`, `base?`, `head?`, `paths?`, `committed_only?`, `title?`, `replace?` | A Git diff card when the operator asks to see the changes, or before submitting a pull request. No `base`: uncommitted work (staged, unstaged, untracked) against HEAD. `base` (e.g. `main`): everything since the merge base, which is what a PR contains, plus uncommitted work unless `committed_only`. `head` (e.g. `pipelines/run-123`): that revision instead of the work tree, against `base` or HEAD. `paths`: repository-relative files, directories or globs (`*.go`), at most 50. Pipelines runs Git; do not paste the diff. |
| `show_run` | `run_id`, `title?`, `replace?` | A live card for a run: pipeline, title, status, current stage, duration; it updates as the run progresses and opens the run when tapped. |
| `schedule_followup` | `message`, `at?` or `after_minutes?` | Queue a prompt to yourself in this chat, 1 minute to 7 days ahead (`at` is RFC 3339). It is a scheduled message from "Agent follow-up" the operator can remove; it does not hold the operator's own messages back, and is delivered when the chat is free at that time. At most 3 pending per chat. Do not wait for it in the current turn. |
| `notify` | `title`, `message`, `priority?` | A phone push that opens this chat. Only when the operator must look now (long task done, blocked on them). 5 per minute per chat; undelivered sends report why. |
`show_diff` lists at most 300 files; a file patch over 256 KiB or a total over
1 MiB is shown partially and says so; binaries have no patch; renames show as
delete plus add. `base` is a plain revision name. Tools are absent when the
delete plus add. `base` and `head` are plain revision names, and `paths` stay
inside the repository (no `..`, absolute paths or pathspec magic). Tools are absent when the
harness could not register them (logged); then name paths instead.
## References sent into the chat