/mirra:google-gmailfrom mirra
Manages Gmail via Mirra API: send/search/list/delete emails, create/update/delete drafts. Requires user's Mirra API key and OAuth-connected Gmail account.
Ships in mirra. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Gmail email management and automation
You need the user's API key. Ask for these if not provided:
API_KEY: Mirra API key (generated in Mirra app > Settings > API Keys)API_URL: Defaults to https://api.fxn.world (only ask if they mention a custom server)Note: Gmail requires OAuth authentication. The user must have connected their Gmail account in the Mirra app before these operations will work.
All operations use a single POST endpoint with the resource ID and method in the body:
curl -s -X POST "${API_URL}/api/sdk/v2/resources/call" \
-H "Content-Type: application/json" \
-H "x-api-key: ${API_KEY}" \
-d '{
"resourceId": "google-gmail",
"method": "{operation}",
"params": { ...args }
}' | jq .
Replace {operation} with the operation name from the table below.
Legacy alternative:
POST ${API_URL}/api/sdk/v1/googleGmail/{operation}with args as the request body also works but is not recommended for new integrations.
| Operation | Description |
|---|---|
sendEmail | Send an email via Gmail |
searchEmails | Search emails with Gmail query syntax. Returns normalized email summaries. |
listEmails | List recent emails from inbox. Returns normalized email summaries. |
getEmail | Get full details of a specific email by ID. Returns normalized flat structure. |
createDraft | Create a draft email in Gmail |
updateDraft | Update an existing draft email |
deleteDraft | Delete a draft email |
listDrafts | List all draft emails. Returns normalized draft summaries. |
deleteEmail | Delete an email |
bulkDeleteEmails | Delete multiple emails at once. Uses Gmail batchDelete API for efficiency. |
sendEmailSend an email via Gmail
Arguments:
to (string, required): Valid email addresssubject (string, required): Email subject linebody (string, required): Email body contentcc (string, optional): CC recipients (comma-separated email addresses)bcc (string, optional): BCC recipients (comma-separated email addresses)isHtml (boolean, optional): Whether body is HTML formatReturns:
AdapterOperationResult: Email send confirmation with message ID
Example:
curl -s -X POST "${API_URL}/api/sdk/v2/resources/call" \
-H "Content-Type: application/json" \
-H "x-api-key: ${API_KEY}" \
-d '{"resourceId":"google-gmail","method":"sendEmail","params":{"to":"[email protected]","subject":"Hello","body":"This is a test email"}}' | jq .
Example response:
{
"messageId": "msg_abc123"
}
Warning: This is a destructive operation. Confirm with the user before executing.
searchEmailsSearch emails with Gmail query syntax. Returns normalized email summaries.
Arguments:
query (string, required): Gmail search query (e.g., "from:[email protected] is:unread")maxResults (number, optional): Maximum number of results to return (default: 50, max: 100)Returns:
AdapterOperationResult: Array of normalized email summaries with flat structure
Example:
curl -s -X POST "${API_URL}/api/sdk/v2/resources/call" \
-H "Content-Type: application/json" \
-H "x-api-key: ${API_KEY}" \
-d '{"resourceId":"google-gmail","method":"searchEmails","params":{"query":"from:[email protected] is:unread","maxResults":5}}' | jq .
Example response:
{
"query": "from:[email protected] is:unread",
"count": 1,
"emails": [
{
"id": "msg_abc123",
"threadId": "thread_xyz",
"subject": "Meeting Tomorrow",
"from": "[email protected]",
"to": "[email protected]",
"date": "2024-01-15T10:30:00.000Z",
"snippet": "Just wanted to confirm our meeting...",
"labelIds": [
"INBOX",
"UNREAD"
],
"isUnread": true,
"hasAttachments": false
}
]
}
listEmailsList recent emails from inbox. Returns normalized email summaries.
Arguments:
maxResults (number, optional): Maximum number of results to return (default: 50, max: 100)Returns:
AdapterOperationResult: Array of normalized email summaries
Example:
curl -s -X POST "${API_URL}/api/sdk/v2/resources/call" \
-H "Content-Type: application/json" \
-H "x-api-key: ${API_KEY}" \
-d '{"resourceId":"google-gmail","method":"listEmails","params":{"maxResults":20}}' | jq .
Example response:
{
"query": "",
"count": 2,
"emails": [
{
"id": "msg_1",
"threadId": "thread_1",
"subject": "Welcome!",
"from": "[email protected]",
"to": "[email protected]",
"date": "2024-01-15T09:00:00.000Z",
"snippet": "Welcome to our service...",
"labelIds": [
"INBOX"
],
"isUnread": false,
"hasAttachments": false
}
]
}
getEmailGet full details of a specific email by ID. Returns normalized flat structure.
Arguments:
messageId (string, required): Gmail message IDincludeHtml (boolean, optional): Include HTML body content (default: false)includeAttachments (boolean, optional): Include attachment metadata (default: false)Returns:
AdapterOperationResult: Normalized email with all fields extracted to flat structure
Example:
curl -s -X POST "${API_URL}/api/sdk/v2/resources/call" \
-H "Content-Type: application/json" \
-H "x-api-key: ${API_KEY}" \
-d '{"resourceId":"google-gmail","method":"getEmail","params":{"messageId":"msg_abc123"}}' | jq .
Example response:
{
"id": "msg_abc123",
"threadId": "thread_xyz",
"subject": "Test Email",
"from": "John Doe <[email protected]>",
"to": "[email protected]",
"date": "2024-01-15T10:30:00.000Z",
"body": "This is the email body content in plain text.",
"snippet": "This is the email body content...",
"labelIds": [
"INBOX",
"IMPORTANT"
],
"isUnread": false,
"hasAttachments": false
}
createDraftCreate a draft email in Gmail
Arguments:
to (string, required): Valid email addresssubject (string, required): Email subject linebody (string, required): Email body contentcc (string, optional): CC recipients (comma-separated email addresses)bcc (string, optional): BCC recipients (comma-separated email addresses)isHtml (boolean, optional): Whether body is HTML formatReturns:
AdapterOperationResult: Draft creation confirmation with draft ID
Example:
curl -s -X POST "${API_URL}/api/sdk/v2/resources/call" \
-H "Content-Type: application/json" \
-H "x-api-key: ${API_KEY}" \
-d '{"resourceId":"google-gmail","method":"createDraft","params":{"to":"[email protected]","subject":"Draft Subject","body":"Draft content"}}' | jq .
Example response:
{
"draftId": "draft_xyz789"
}
Warning: This is a destructive operation. Confirm with the user before executing.
updateDraftUpdate an existing draft email
Arguments:
draftId (string, required): Gmail draft ID to updateto (string, optional): Updated recipient email address(es)subject (string, optional): Updated email subject linebody (string, optional): Updated email body contentcc (string, optional): Updated CC recipientsbcc (string, optional): Updated BCC recipientsisHtml (boolean, optional): Whether body is HTML formatReturns:
AdapterOperationResult: Draft update confirmation
Example:
curl -s -X POST "${API_URL}/api/sdk/v2/resources/call" \
-H "Content-Type: application/json" \
-H "x-api-key: ${API_KEY}" \
-d '{"resourceId":"google-gmail","method":"updateDraft","params":{"draftId":"draft_xyz789","subject":"Updated Subject","body":"Updated content"}}' | jq .
Example response:
{
"draftId": "draft_xyz789",
"updated": true
}
deleteDraftDelete a draft email
Arguments:
draftId (string, required): Gmail draft ID to deleteReturns:
AdapterOperationResult: Draft deletion confirmation
Example:
curl -s -X POST "${API_URL}/api/sdk/v2/resources/call" \
-H "Content-Type: application/json" \
-H "x-api-key: ${API_KEY}" \
-d '{"resourceId":"google-gmail","method":"deleteDraft","params":{"draftId":"draft_xyz789"}}' | jq .
Example response:
{
"deleted": true
}
listDraftsList all draft emails. Returns normalized draft summaries.
Arguments:
maxResults (number, optional): Maximum number of drafts to return (default: 10)Returns:
AdapterOperationResult: Array of normalized draft summaries
Example:
curl -s -X POST "${API_URL}/api/sdk/v2/resources/call" \
-H "Content-Type: application/json" \
-H "x-api-key: ${API_KEY}" \
-d '{"resourceId":"google-gmail","method":"listDrafts","params":{"maxResults":20}}' | jq .
Example response:
{
"count": 2,
"drafts": [
{
"id": "draft_abc123",
"messageId": "msg_xyz789",
"subject": "Follow up on project",
"to": "[email protected]",
"snippet": "Hi, just wanted to follow up..."
},
{
"id": "draft_def456",
"messageId": "msg_uvw012",
"subject": "Meeting notes",
"to": "[email protected]",
"snippet": "Here are the notes from..."
}
]
}
deleteEmailDelete an email
Arguments:
messageId (string, required): Gmail message ID to deleteReturns:
AdapterOperationResult: Email deletion confirmation
Example:
curl -s -X POST "${API_URL}/api/sdk/v2/resources/call" \
-H "Content-Type: application/json" \
-H "x-api-key: ${API_KEY}" \
-d '{"resourceId":"google-gmail","method":"deleteEmail","params":{"messageId":"msg_abc123"}}' | jq .
Example response:
{
"deleted": true
}
Warning: This is a destructive operation. Confirm with the user before executing.
bulkDeleteEmailsDelete multiple emails at once. Uses Gmail batchDelete API for efficiency.
Arguments:
messageIds (array, required): Array of Gmail message IDs to delete (max 1000 per request)permanently (boolean, optional): If true, permanently delete. If false (default), move to trash.Returns:
AdapterOperationResult: Bulk deletion confirmation with count of deleted emails
Example:
curl -s -X POST "${API_URL}/api/sdk/v2/resources/call" \
-H "Content-Type: application/json" \
-H "x-api-key: ${API_KEY}" \
-d '{"resourceId":"google-gmail","method":"bulkDeleteEmails","params":{"messageIds":["msg_abc123","msg_def456","msg_ghi789"]}}' | jq .
Example response:
{
"deletedCount": 3,
"deleted": "trash"
}
Warning: This is a destructive operation. Confirm with the user before executing.
All SDK responses return the operation payload wrapped in a standard envelope:
{
"success": true,
"data": { ... }
}
The data field contains the operation result. Error responses include:
{
"success": false,
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message"
}
}
jq . to pretty-print responses, jq .data to extract just the payloaddata.results or directly in data (check examples)--fail-with-body to curl to see error details on HTTP failuresexport API_KEY="your-key"What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub oz-networks/mirra-sdk --plugin mirra39 skills in this plugin
/aiUse Mirra to access ai services for chat, decisions, and streaming with multi-provider support. Covers all AI Services SDK operations via REST API./channelsUse Mirra to the places a space publishes to — its corporate x, blog, newsletter — and the drafted copy waiting to go out to them. use listchannels to see what this space.... Covers all Space Channels SDK operations via REST API./contactsUse Mirra to manage user contacts - list, add, remove, search, block, and unblock contacts. Covers all Contacts SDK operations via REST API./coworkCowork with another person's Claude Code over a shared Mirra group chat. Post questions, wait for replies in near-real-time (long-poll), and hand off follow-ups. Rides the Mirra Messaging adapter — no extra integration to install./cryptoUse Mirra to cryptocurrency price monitoring and token transfers. Covers all Crypto SDK operations via REST API./dashboardsUse Mirra to living dashboards — natively-rendered grids of typed widgets (stat, image_card, list, progress, sparkline) that flows keep current by pushing data into them..... Covers all Dashboards SDK operations via REST API.