Skip to main content
Glama
drawcommons-ledger

drawcommons-ledger

entry_draft

Read-only

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

NameRequiredDescriptionDefault
bodyNoThe request body to send. For confirm's first stage just {entry_id}; for the second stage {kind, entry_id, sig}. Omitted for contact.
nonceNoOptional 22-64 char [A-Za-z0-9_-]; defaults to a fresh random one. Do not reuse a nonce that was spent.
partyYesThe party id whose key will sign (the one you hold).
queryNoQuery string only (e.g. id=rq_abc12345), no leading ?. Required for contact. Query strings are not signed.
issuedNoOptional YYYY-MM-DDTHH:MM:SSZ; defaults to this machine's UTC now. The server accepts a 15-minute window only (DGB_ING_004).
endpointYesWhich write to prepare. contact is the signed GET for both parties' contact details.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.3

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well past the annotations: it discloses that no field validation or id-existence check occurs and explains why (avoiding an oracle), that dry_run rolls the transaction back and does not spend the nonce, that the server only accepts a 15-minute issued window, and that the chain hash is read rather than recomputed. The safety profile (readOnlyHint true, destructive false) is consistent with 'writes NOTHING', though it could state whether the printed commands block executes anything automatically.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Core purpose and the no-write guarantee are front-loaded, and most paragraphs carry load-bearing detail. It is longer than typical and includes discursive asides (the build_chain 'right most of the time' remark, the oracle rationale) that could be trimmed without losing actionable guidance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description carries the return contract itself and does so precisely (body_text 'do not re-serialize', body_sha256, 7-line signed payload, issued, nonce, commands {dry_run, send}), and it closes the loop on the two unsupported endpoints and the recommended dry_run fallback. Nothing an agent needs to call this correctly appears missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already defines all six parameters, but the description adds genuine meaning the schema cannot: the staged body shapes for confirm ({entry_id} then {kind, entry_id, sig}), what the 'stage' signal is, and the nonce-spend implication behind 'Do not reuse a nonce that was spent'. That is above the baseline 3 for a fully documented schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb and resource: drafts the exact bytes to sign for one write and prints a shell block; it also explicitly bounds scope with 'writes NOTHING and POSTs NOTHING', which separates it from ledger_items/ledger_export-style read tools. An agent knows within the first sentence what it gets back and what it does not.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete triggering situations (publish/claim/deliver a request, register a party, record an entry, confirm a give) plus an explicit two-stage protocol for endpoint=confirm, and names what is out of scope (reject and remind, which must be signed by hand). That is when-to-use, how-to-sequence and when-not-to-use in one place.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.