DiviMail

v1.5.1
tech.divindi/divimail Checked 1 day ago Published 28 days ago

Give your AI agent its own email address: send, receive and read email.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

divimail_register

Give an AI agent its own @divindi.io email address so it can send and receive email. Call this once to create the address, then call divimail_login (or divimail_challenge + divimail_authenticate) to get a token. Use exactly one of: provision:true (easiest), publicKey (your ed25519 key; only the public key is stored), or nearAccountId (own NEAR wallet, no apiKey). provision/publicKey return an apiKey shown ONCE, so save it.

ParameterTypeDescription
emailAlias *stringDesired email alias (e.g. myagent → myagent@divindi.io)
nearAccountIdstringNEAR account ID (e.g. myagent.near) — omit to auto-provision a new NEAR account
provisionbooleanSet true to auto-provision a NEAR account if you do not have one. A provisioned registration returns a one-time apiKey — save it and use divimail_login.
publicKeystringYour own ed25519 public key (base58, optionally "ed25519:"-prefixed; must decode to 32 bytes). Client-side keygen: DiviMail stores only this public key and holds no private key. Returns a one-time api…

divimail_login

Sign the agent in to its DiviMail address and get the token needed to send, check the inbox, top up or pay. Use this after divimail_register when you have the saved apiKey (starts with "dm_"). Use divimail_challenge/divimail_authenticate for own-wallet accounts instead. No NEAR signature or service secret needed. Returns a JWT.

ParameterTypeDescription
apiKey *stringThe one-time apiKey returned by a provisioned divimail_register (starts with "dm_")
email *stringYour @divindi.io email address (from divimail_register)

divimail_challenge

Start signing in with your own key or NEAR wallet: returns a challenge message to sign. Step 1 of 2. Sign it, then call divimail_authenticate. For accounts created with provision:true, use divimail_login instead (simpler). Automated agents with a service secret can use divimail_service_token.

ParameterTypeDescription
accountId *stringYour NEAR account ID (e.g. myagent.near)

divimail_authenticate

Finish signing in with your own key or NEAR wallet and get the token used for sending, inbox, top-up and pay. Step 2 of 2: call after divimail_challenge with your Ed25519 signature (base64) and public key (base58). For provision:true accounts, use divimail_login instead. Returns a JWT.

ParameterTypeDescription
accountId *stringYour NEAR account ID
publicKey *stringBase58-encoded NEAR public key
signature *stringBase64-encoded Ed25519 signature of the challenge message

divimail_service_token

Get a token for a scheduled or unattended agent without a live signature or apiKey. Use only when this MCP server has DIVIMAIL_SERVICE_SECRET set (operator-issued). Otherwise use divimail_login (apiKey) or divimail_challenge/divimail_authenticate. Pass serviceSecret only to override the env var. Returns a JWT.

ParameterTypeDescription
accountId *stringThe NEAR account ID of the agent (e.g. patch.divimail.near)
serviceSecretstringOverride only — omit to use the server's DIVIMAIL_SERVICE_SECRET env var

divimail_send

Send an email from your agent's @divindi.io address to any email address, human or agent. Needs a token from divimail_login (or authenticate/service_token). If the balance is low, see divimail_balance and divimail_request_topup. Costs $0.01 USDC per email. Supports plain text, optional HTML, CC and BCC.

ParameterTypeDescription
from *stringSender DiviMail address (e.g. myagent@divindi.io)
subject *stringEmail subject line
text *stringPlain text email body
to *stringRecipient email address (any email — not just @divindi.io)
token *stringJWT token from divimail_login, divimail_authenticate or divimail_service_token
bccOptional BCC recipient(s) — a single email or an array of emails
ccOptional CC recipient(s) — a single email or an array of emails
htmlstringOptional HTML email body

divimail_inbox

Check your agent's inbox: lists received emails for its @divindi.io address. Call this first to see what arrived, then use divimail_read with a messageId for the full content, and divimail_mark_read when done. For mail the agent sent, use divimail_sent. Needs a token. Optional limit (default 20).

ParameterTypeDescription
email *stringYour agent's full @divindi.io email address (e.g. myagent@divindi.io)
token *stringJWT token from divimail_login, divimail_authenticate or divimail_service_token
limitnumberNumber of messages to return (default 20)

divimail_sent

See what emails your agent has sent: lists sent messages for its @divindi.io address. Use this to confirm a divimail_send went out or to review history. For received mail use divimail_inbox. Needs a token. Optional limit (default 20).

ParameterTypeDescription
email *stringYour agent's full @divindi.io email address (e.g. myagent@divindi.io)
token *stringJWT token from divimail_login, divimail_authenticate or divimail_service_token
limitnumberNumber of messages to return (default 20)

divimail_read

Open and read one email in full (body and details) from your agent's mailbox. Call after divimail_inbox using a messageId from that list; then call divimail_mark_read if you want it marked read. Needs a token.

ParameterTypeDescription
email *stringYour agent's full @divindi.io email address (e.g. myagent@divindi.io)
messageId *stringMessage ID from divimail_inbox
token *stringJWT token from divimail_login, divimail_authenticate or divimail_service_token

divimail_mark_read

Mark an email in your agent's inbox as read so it is not handled twice. Use after divimail_read (or divimail_inbox) with the same messageId. Needs a token.

ParameterTypeDescription
email *stringYour agent's full @divindi.io email address (e.g. myagent@divindi.io)
messageId *stringMessage ID from divimail_inbox
token *stringJWT token from divimail_login, divimail_authenticate or divimail_service_token

divimail_balance

Check how much USDC a DiviMail address has for sending email or paying. Call before divimail_send or divimail_pay if unsure; if low, use divimail_request_topup. No token needed, just the @divindi.io address.

ParameterTypeDescription
email *stringThe @divindi.io email address to check

divimail_request_topup

Add funds so your agent can keep sending email: returns USDC deposit instructions for its DiviMail balance. It does not move money itself. Use when divimail_balance is low. Returns a NEAR mainnet deposit address plus NEAR Intents links for Base, Ethereum, Arbitrum and Solana; credited automatically within 60 s. Needs a token.

ParameterTypeDescription
alias *stringYour email alias (e.g. "patch" for patch@divindi.io)
token *stringJWT token from divimail_login, divimail_authenticate or divimail_service_token

divimail_pay

Pay another agent (or person) that has a @divindi.io address, in USDC from your DiviMail balance. Use for agent-to-agent payments, not for funding yourself (use divimail_request_topup). Free, instant internal transfer. Max $50 per transfer, $100 per sender per rolling 24h. Non-DiviMail addresses not supported. Needs a token.

ParameterTypeDescription
amountUsdc *number | stringAmount in USDC, > 0, at most 6 decimal places, max 50 (e.g. 1.25)
from *stringYour @divindi.io email address (must match the token)
to *stringRecipient @divindi.io email address
token *stringJWT token from divimail_login, divimail_authenticate or divimail_service_token
memostringOptional note stored with the transfer (max 280 chars)