| name | publish |
| description | Publish this session (or a described slice) as a shareable Batonlink baton URL. Use when the user asks to publish, share, or hand off the current session/progress as a baton. |
[[batonlink-publish-kickoff]]
The tools below live on the batonlink MCP server.
You are publishing the current session as a Batonlink baton — a work-context package another agent can pick up by fetching a URL.
A baton has two layers:
- Layer 1 (brief): YOUR distillation — a short title (a preview label, max 200 chars) plus a markdown body carrying the full purpose: situation, key context, decisions made, and recommended next steps. Only you can write this.
- Layer 2 (transcript): the verbatim conversation, attached automatically. Do not paraphrase it.
Steps:
- Call list_messages with no arguments to see the recent window. It ends before the current publish's tool calls (publishableEnd), so any work done in the same turn as the request stays in view. Indices are absolute and may skip numbers where tool messages are hidden. Rows marked publishNoise: true are publish machinery from earlier rounds (batonlink tool chatter, baton-URL replies); a natural-language publish request itself is not marked. If the discussion you need is older than the window, page earlier by passing beforeIndex = the window's from.
- Choose ranges as 1-based inclusive { start, end } objects using the absolute index values you saw. A range is a span and includes every message between start and end, even hidden ones. Exclude the current publish's tool chatter and baton-URL reply. Omitting ranges publishes everything up to publishableEnd and automatically excludes publishNoise rows; select those rows explicitly only if the user wants them included.
- Write a short title (label only — everything the receiver must know goes in the body) and the markdown body, in the conversation's language. The baton page renders the title as its heading, so do not open the body by repeating that title as an H1 — start the body straight from the substance (situation, key context, decisions, next steps).
- Call publish_baton with { title, body, ranges: [{ start, end }] } — or omit ranges to publish everything up to publishableEnd (the common case). Optionally attach external links (a PR, issue, or doc) via references: [{ url, title?, description? }] with absolute https URLs.
- Show the returned URL to the user.
First publish needs approval: if no Batonlink API key is saved, publish_baton opens a browser approval page — tell the user to approve there. If no browser can open (headless / SSH), tell the user to set the BATONLINK_API_KEY environment variable instead.
If the user named a scope (e.g. "only the schema discussion"), honor it when
choosing ranges.