entry_draft
Drafts the exact bytes to sign for a ledger write and returns a shell block to sign and send, without writing or POSTing. Use it to prepare publish, claim, or confirm requests.
Instructions
Drafts the exact bytes you would have to sign for one write, and prints a self-contained shell block that signs and sends them. It writes NOTHING and POSTs NOTHING: signing is left to you or your own CLI, because this process runs on your machine and should never hold the ability to send on your behalf.
Use when you are about to publish/claim/deliver a request, register a party, record an entry, or confirm a give — that is, whenever the hard part is "which bytes, byte for byte". Returns body_text (send exactly these bytes, do not re-serialize), body_sha256, the payload to sign (7 lines for the envelope), issued, nonce, and commands {dry_run, send}.
confirm has two stages, because a confirmation carries two signatures. Call it with endpoint=confirm and body={entry_id} and no sig: you get the 3-line inner payload and the give's current chain hash, read from /api/ledger/items (never recomputed locally — recomputing would mean reimplementing build_chain, whose failure mode is "right most of the time"). Sign that, put the armor into body.sig, and call again to get the envelope. stage tells you which one you got.
It deliberately does NOT validate fields and does NOT check whether an id exists: a free validator that answers "would this be rejected" is an oracle the write side chooses not to be. Sign first, then use ?dry_run=1 (the dry_run block) — validation runs, the transaction rolls back, the nonce is not spent.
Not covered: reject and remind. Their payloads need the seq of the current delivered row, which the public view does not expose; sign those by hand per /agent.md 5.1.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"endpoint": "<endpoint>",
"party": "<party>"
},
"name": "entry_draft"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | The request body to send. For confirm's first stage just {entry_id}; for the second stage {kind, entry_id, sig}. Omitted for contact. | |
| nonce | No | Optional 22-64 char [A-Za-z0-9_-]; defaults to a fresh random one. Do not reuse a nonce that was spent. | |
| party | Yes | The party id whose key will sign (the one you hold). | |
| query | No | Query string only (e.g. id=rq_abc12345), no leading ?. Required for contact. Query strings are not signed. | |
| issued | No | Optional YYYY-MM-DDTHH:MM:SSZ; defaults to this machine's UTC now. The server accepts a 15-minute window only (DGB_ING_004). | |
| endpoint | Yes | Which write to prepare. contact is the signed GET for both parties' contact details. |