ofw_save_draft
Saves a message as a draft in OurFamilyWizard, holding attachments and reply targets until sent. Replace an existing draft safely by detecting changes made in the web app.
Instructions
Save a message as a draft in OurFamilyWizard. RECIPIENTS: OurFamilyWizard has not reliably kept recipients on drafts (when the saved draft comes back with none it is noted once, not warned about) — supply recipientIds at send time as well. ATTACHMENTS: OurFamilyWizard does not store files on drafts, so myFileIDs / inlineAttachments / blobKeys are HELD with the draft by this server (carried across edits, de-duplicated; removeFileIDs drops one), shown under attachments.held, folded into revision, and attached when the draft is sent with ofw_send_message(draftId). They are not visible on the draft in the OurFamilyWizard web app. IDENTITY: the response leads with draftKey, the stable identity that survives editing — key off it, because the id changes on EVERY edit (replacing a draft creates a NEW draft and deletes the old one; OFW's update-in-place endpoint silently no-ops, so we never use it). Pass messageId to replace an existing draft; the response.id will be the NEW id, and a transparency NOTE documents the swap and which fields were carried over. THREADING: if replyToId is provided, the cache may rewrite it to the latest reply in the thread (note included). The threading verdict is read from OFW's full echo (replyToId/inReplyTo/showContext) — a warning appears ONLY when the reply linkage was genuinely dropped or re-targeted. When OFW's echo omits the linkage entirely, the posted target is kept and marked replyToSource:"cache". Replacing a draft (messageId) without replyToId keeps the draft's own reply target. RESPONSE: compact by default — no listData echo, and the body you wrote is returned as bodyLength + bodySha256; view:"full" returns both. After saving, the tool re-fetches the draft from OFW, and the returned revision reflects that authoritative state (so it will match on your next edit). SAFETY: because replacing DESTROYS the old draft rather than merging, passing messageId first re-reads that draft from OFW and REFUSES the write if its subject/body/recipients changed since you read it (drafts edited in the OFW web app do not bump any timestamp, so the local cache can be silently behind). A pure replyToId normalization by OFW is NOT treated as a conflict. The refusal returns the current server body under serverBody — merge your edit into it and retry with expectedRevision.
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": {
"subject": "<subject>",
"body": "<body>"
},
"name": "ofw_save_draft"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | Message body text | |
| view | No | Response shape: "compact" (default) drops fields the response already carries elsewhere; "full" returns every field this server understands. compact omits OurFamilyWizard's raw `listData` echo (which repeats the body, subject, recipients and a date block) and replaces the body you just wrote with `bodyLength` + `bodySha256` (the first 16 hex characters of its SHA-256) to confirm what landed. Pass "full" for both. | |
| force | No | Default false. Overwrite even when the draft changed on OurFamilyWizard since you read it. The discarded server version is echoed back in the response. Only use after showing the user the conflict. | |
| subject | Yes | Message subject | |
| blobKeys | No | Hosted deployments: blobKeys from ofw_upload_attachment uploadSlots whose files you have already PUT. Each is uploaded to My Files as PRIVATE, attached alongside any myFileIDs, and deleted from the upload store. | |
| messageId | No | ID of an existing draft to replace (the new draft will have a new id; the old is deleted) | |
| myFileIDs | No | Attachment file ids (from ofw_upload_attachment) to attach. OurFamilyWizard does not store attachments on drafts, so they are HELD with this draft by this server and attached when you send it with ofw_send_message(draftId). When replacing a draft (messageId), the files already held are kept and these are added (de-duplicated); use removeFileIDs to drop one. | |
| replyToId | No | ID of the message this draft replies to. When replacing a draft (messageId), omit it to keep the draft's own reply target, or pass null to make the draft a new top-level message. | |
| bodyFormat | No | How to treat `body`. OurFamilyWizard shows message bodies as PLAIN TEXT — Markdown is never rendered, so **bold** would reach the co-parent with its asterisks. Default "markdown": Markdown is converted to plain text before anything is saved or sent (bold/italic markers and # heading markers dropped; [text](url) → "text (url)"; lists normalized to "-" bullets and renumbered 1., 2., … with a., b. for the second level, 4 spaces per nesting level; code, URLs and ~~strikethrough~~ left as written), and the response reports what changed under bodyConversion. "plain": send the body byte-for-byte. Line breaks, blank lines and leading spaces always survive; full https:// URLs, email addresses and phone numbers become links for the reader. | |
| recipientIds | No | Array of recipient user IDs (optional for drafts) | |
| removeFileIDs | No | When replacing a draft: held attachment file ids to drop. | |
| expectedRevision | No | With messageId: the `revision` you got from ofw_list_drafts/ofw_get_message for that draft. Asserts you are replacing THAT version. If the draft changed on OFW since, the write is refused and the current server body is returned. Omit and the tool compares the server against the local cache instead — omitting never means "overwrite anyway". | |
| inlineAttachments | No | Files to attach, supplied as base64 BYTES ({filename, contentBase64, mimeType?}). Each is uploaded to My Files as PRIVATE and attached alongside any myFileIDs (a send attaches PRIVATE files as they are). Use for small files; on a hosted deployment, larger files (phone photos) go faster through ofw_upload_attachment uploadSlots + blobKeys here. Every entry is validated before anything is uploaded. |