Skip to content

AI Tool Reference

For integrators and anyone pointing their own MCP client at TongueToQuill. The MCP endpoint exposes five tools, plus claim_document on deployments that turn on device-code claiming. Each request stands alone: the server keeps no session, and the claim token the model carries is what ties a revision to its draft. Input and output schemas come back from list_tools; this page covers the behavior that isn't on the wire.

Every result that has a next step ends with a → Next: line naming the tool to call, with the values the server already holds filled in.

Call sequence

  1. list_quills, when the format isn't already known.
  2. get_specs for the chosen Quill.
  3. Edit the blueprint into the document.
  4. create_document returns a claim link and a claim token.
  5. Show the user the link and ask them to open it and sign in. Under device-code claiming, also ask for the six-digit code it shows, then call claim_document with the token and code.
  6. To revise, call get_specs again, then update_document with the same token.

When the user supplies a template short code, start with get_template and build from its content instead of a blank blueprint. Drafting with AI § Claiming the draft covers the claim from the user's side.

list_quills

Returns the Quills this deployment serves, as name@version with a description. Write the chosen one into the document's $quill. A bare name takes the newest version the deployment holds; name@MAJOR.MINOR, such as usaf_memo@0.3, holds the document to that format line. See Quillmark Format § Version selectors.

get_template

Fetches a published template by its short code (such as HeLiBeKrXeFeCoNiZnAr), returning its markdown and the Quill it targets (quill_ref). The app shows no template's short code, so a user has one only from outside it. Call it only when the user supplies a code. Then call get_specs for that quill_ref; a template with no quill_ref is used as it stands.

get_specs

Returns the spec for one Quill: an instruction carrying the authoring rules and the deployment's field policy, and a blueprint, which is the Quill's fields as a document ready to fill. Call it before create_document and again before every update_document, and build the document by editing the blueprint rather than writing from memory.

In the blueprint, an empty value awaits an answer and a value shown is the default: keep it, change it, or delete the line. Comments carry each field's label and type; an # e.g. line shows a value's shape, not data to copy. Optional cards appear as one sample card to copy or delete.

An unknown Quill comes back as an error listing the ones available.

create_document

Validates content and stores it as an unclaimed draft, taking the document name and an optional author display name. Returns the claim link and the claim token. The draft expires five minutes later unless claimed.

Show the user the link, never the token, and keep the token: every later call for this draft needs it.

claim_document

Registered only under device-code claiming. Takes the claim token and the six-digit code the user pasted, and binds the draft to the account that opened the link; the user's open claim page then shows the draft.

The code works once and locks after five wrong tries, so if the user mistypes, ask them to re-enter it rather than retrying the same value. If the claim window lapsed, start over with a fresh create_document. Keep the claim token afterward.

update_document

Replaces a claimed draft's content in place: no new link or code. Takes the claim token and the full new content, built from the draft's current content rather than a blank blueprint. name and author are optional; an omitted name keeps the current title.

Each update extends the draft to 24 hours from that change. The token edits the draft only: a copy the user already saved with Save Copy doesn't change. The call can't read the draft back or change its owner.

Errors

A failed call returns isError: true with plain text. Each engine diagnostic in it carries a severity, a message, a stable code (validation::type_mismatch, validation::enum_violation, parse::missing_kind), a rooted path to the offending value (main.memo_for, cards.indorsement[0].action), and, where available, a hint and a line and column.

  • Parse failure — the content isn't readable card-yaml: --- front matter, a missing blank line above a ~~~, a card with no $kind, a $ key outside $quill, $kind, $ext, and $seed. The text starts "Document parse failed:".
  • Validation errors — a value that won't read as its field's type, such as an enum value not in its list or a malformed date. Three warnings are refused like errors on this path, because the render would silently drop what was written: a card kind the Quill doesn't declare (validation::unknown_card), a body on a card that takes none (validation::body_disabled), and a line break in a one-line field (validation::line_break_folded).
  • Policy rejection — a value the deployment disallows, such as a classification above its ceiling. The get_specs instruction states the policy up front.
  • Storage failure — the server couldn't save the draft.

Fix the named value and call again; nothing needs cleaning up between attempts.

Claim security model

Three values tie a draft to its owner:

  • Claim token — the assistant's secret, returned by create_document and never shown to the user. It authorizes the assistant's revisions (and, with a device code, the claim itself) for the draft's lifetime. It can overwrite the draft but cannot read it or change its owner.
  • Claim link — the /claim/<code> URL, which travels in clear chat text. Its page holds sign-in and the claim, and shows no document content before the claim.
  • Device code — six digits, minted only under device-code claiming, and shown only to the account that opened the link.

All three are stored only as hashes. Once claimed, the draft opens only for its owner's session; knowing its address is not enough.

What each mode protects against

By default the claim link is the whole key: the first person to open it and sign in owns the draft. Device-code claiming makes the link alone worthless, because claiming also takes the token the assistant holds.

Neither mode stops a prompt injection, where content the assistant reads instructs it to leak its context. The link appears in chat text, so an injection that reads the conversation has it, and under device-code claiming it has the token too. Keeping the link out of the model's view would close that path; the MCP endpoint has no surface outside the chat to show it on, so every draft it creates is delivered in chat.

Who has what Default claim Device-code claim
Someone with only the link (forwarded, overheard) Claims and reads the draft Gains nothing
An injection that reads the conversation Claims and reads the draft Claims and reads the draft

First visitor wins

Both modes let the first visitor take the link, at different costs.

By default the first signed-in visitor owns the draft, and the user lands on "already claimed". That is a disclosure, accepted because the draft is content the user just asked for and the link lives five minutes.

Under device-code claiming the first visitor only stages a claim. Without the token they gain nothing, but the user lands on "claimed by a different account" and the draft expires unclaimed. That costs the draft, not its contents.

Which mode a deployment runs

claim_document is registered only under device-code claiming, so a deployment whose tool list omits it claims on sign-in alone.

Giving an assistant this site

To hand an assistant the whole documentation as context, give it llms.txt.