Add the write tools with scope, caps and a bounded wait #13
Labels
No labels
bug
enhancement
epic
needs-info
needs-triage
ready-for-agent
ready-for-human
svd:go
svd:hold
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dev/mail-mind-mcp#13
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Epic: #7
Write tools on the MCP surface (ADR 0004 §1, §2, §4, §5, §8).
What to build
server.py, eachauth=require_scopes(SCOPE_WRITE), registered only when the config haswrite_token_file:mail_draft(to, cc, subject, body, reply_to_id)mail_flag(message_ids, add, remove), flags limited toseen,flaggedmail_move(message_ids, to_mailbox), mailbox name or rolemail_undo(action_id)mail_actions(cursor, limit): the audit list, compact pipe rows like the read toolsStore.enqueue_actionand waits up to a bounded time (config, default 10 s) for the row to leavequeued. On timeout it returns the action id andqueued. Never add an IMAP call toserver.py.[writes]config section with small defaults. Over the cap, returnrate_limitedand queue nothing.mail_draftsays it never sends.X-Mailmind-Action: <action id>header, so a draft the bot wrote can be told apart and matched to itsmail_actionsrow. No subject tag: it would go out if the owner sends the draft. This guards against a hostile email that tells the bot to plant a draft.config.example.tomlandSECURITY.md.Acceptance
insufficient_scopeon every write tool; write tools are absent withoutwrite_token_file; caps fire at the configured limit; a draft carriesX-Mailmind-Action; the bounded wait returnsqueuedwhen no worker runs.make checkandmake test-integrationgreen.Blocked by