{"id":"79b4a9b8-23ac-4ec2-9d20-1f1ecd0a2add","entityType":"agent","slug":"clawhub-byungkyu-gmail-2","name":"Gmail","canonicalUrl":"https://www.xpersona.co/agent/clawhub-byungkyu-gmail-2","canonicalPath":"/agent/clawhub-byungkyu-gmail-2","generatedAt":"2026-10-09T14:22:49.951Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-05-14T06:29:33.558Z","emptyReason":null},"description":"Gmail API integration with managed OAuth. Read, send, and manage emails, threads, labels, and drafts. Use this skill when users want to interact with Gmail.... Skill: Gmail Owner: byungkyu Summary: Gmail API integration with managed OAuth. Read, send, and manage emails, threads, labels, and drafts. Use this skill when users want to interact with Gmail.... Tags: latest:1.0.8 Version history: v1.0.8 | 2026-05-07T10:03:31.420Z | user - Added CLI usage examples throughout documentation for common Gmail operations. - Included installation instructions for Maton CLI via NPM and H","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 34.3K downloads reported by the source. Last updated 5/14/2026.","installCommand":"clawhub skill install s174c3s2kc1ehqj1ytzntezj2983e2aj:gmail","sourceUrl":"https://clawhub.ai/byungkyu/gmail","homepage":"https://clawhub.ai/byungkyu/gmail","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/byungkyu/gmail","kind":"source"}],"safetyScore":84,"overallRank":62,"popularityScore":91,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Gmail API integration with managed OAuth. Read, send, and manage emails, threads, labels, and drafts. Use this skill when users want to interact with Gmail.... "},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-05-14T06:29:33.558Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-05-14T06:29:33.558Z","emptyReason":null},"stars":null,"forks":null,"downloads":34311,"packageName":null,"latestVersion":"1.0.8","tractionLabel":"34.3K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-05-14T06:29:33.479Z","emptyReason":null},"lastUpdatedAt":"2026-05-14T06:29:33.558Z","lastCrawledAt":"2026-05-14T06:29:33.479Z","lastIndexedAt":null,"nextCrawlAt":"2026-05-15T06:29:33.479Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.8","createdAt":"2026-05-07T10:03:31.420Z","changelog":"- Added CLI usage examples throughout documentation for common Gmail operations. - Included installation instructions for Maton CLI via NPM and Homebrew. - Expanded Quick Start and Connection Management sections to cover both CLI and Python methods. - Added specific CLI commands for sending, replying, and forwarding messages, as well as label and thread management. - Improved organization and clarity for multi-connection scenarios and authentication steps.","fileCount":2,"zipByteSize":3778},{"version":"1.0.7","createdAt":"2026-04-30T21:25:50.834Z","changelog":"- Updated all API endpoint base URLs from `gateway.maton.ai` and `ctrl.maton.ai` to `api.maton.ai`. - Clarified that only listed API endpoints are supported. - Added notes on scoping, explicit user approval for write operations, and improved security instructions. - Minor example and documentation updates for consistency with the new base URL. - Removed the LICENSE.txt file.","fileCount":2,"zipByteSize":3189},{"version":"1.0.6","createdAt":"2026-02-10T20:35:59.017Z","changelog":"- Added clawdbot metadata for skill compatibility and requirements. - Declared required environment variable (`MATON_API_KEY`) in the metadata section. - No changes to functional documentation or API usage.","fileCount":3,"zipByteSize":3807},{"version":"1.0.5","createdAt":"2026-02-10T12:35:08.096Z","changelog":"- Simplified the \"Base URL\" section and moved critical prefix instructions up front. - Removed redundant instructions and streamlined the authentication and connection setup guides. - Clarified troubleshooting steps for API key errors and added troubleshooting for invalid app names. - Cleaned up and condensed general notes for easier reference. - No API or functionality changes; documentation only.","fileCount":3,"zipByteSize":3766},{"version":"1.0.4","createdAt":"2026-02-08T01:43:50.743Z","changelog":"- Clarified base URL requirements to specify that all paths must start with the connection app name (e.g., `/google-mail/...`). - Added an explicit note emphasizing that the app prefix (such as `/google-mail/`) is required for the gateway to identify the correct connection. - No other content changes detected.","fileCount":3,"zipByteSize":4021},{"version":"1.0.3","createdAt":"2026-02-06T02:17:37.779Z","changelog":"- Switched all shell and cURL examples to Python one-liners using `urllib.request` for easier out-of-the-box use. - Added a new Troubleshooting section for \"Invalid API key\" errors, including detailed step-by-step instructions and Python test code. - Updated quick start and connection management instructions with Python equivalents. - General documentation improvements to streamline getting started and debugging.","fileCount":3,"zipByteSize":3707},{"version":"1.0.2","createdAt":"2026-02-05T01:37:10.194Z","changelog":"- Added a note in the description recommending the api-gateway skill for integration with third party apps other than Gmail. - Updated code samples and curl commands to use environment variable syntax ($MATON_API_KEY) for clarity. - Added important notes about using curl with the -g flag for bracketed URLs and about shell variable expansion issues when piping to jq or other commands.","fileCount":3,"zipByteSize":3434},{"version":"1.0.1","createdAt":"2026-02-03T11:24:45.915Z","changelog":"- Updated base URL documentation: replace `{endpoint}` with `{native-api-path}` for clarity. - Expanded connection response example to include `creation_time`, `last_updated_time`, and `metadata` fields. - Added instructions for specifying a Gmail connection using the `Maton-Connection` header. - Clarified API key acquisition (sign in or create an account). - Minor improvements for accuracy and clarity in usage instructions.","fileCount":3,"zipByteSize":3218}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s174c3s2kc1ehqj1ytzntezj2983e2aj:gmail","setupComplexity":"low","setupSteps":["Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-byungkyu-gmail-2/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-byungkyu-gmail-2/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-byungkyu-gmail-2/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-byungkyu-gmail-2/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-byungkyu-gmail-2/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-byungkyu-gmail-2/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-09T14:22:49.949Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-byungkyu-gmail-2/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-byungkyu-gmail-2/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-byungkyu-gmail-2/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-byungkyu-gmail-2/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-05-14T06:29:33.558Z","emptyReason":null},"readme":"Skill: Gmail\n\nOwner: byungkyu\n\nSummary: Gmail API integration with managed OAuth. Read, send, and manage emails, threads, labels, and drafts. Use this skill when users want to interact with Gmail....\n\nTags: latest:1.0.8\n\nVersion history:\n\nv1.0.8 | 2026-05-07T10:03:31.420Z | user\n\n- Added CLI usage examples throughout documentation for common Gmail operations.\n- Included installation instructions for Maton CLI via NPM and Homebrew.\n- Expanded Quick Start and Connection Management sections to cover both CLI and Python methods.\n- Added specific CLI commands for sending, replying, and forwarding messages, as well as label and thread management.\n- Improved organization and clarity for multi-connection scenarios and authentication steps.\n\nv1.0.7 | 2026-04-30T21:25:50.834Z | user\n\n- Updated all API endpoint base URLs from `gateway.maton.ai` and `ctrl.maton.ai` to `api.maton.ai`.\n- Clarified that only listed API endpoints are supported.\n- Added notes on scoping, explicit user approval for write operations, and improved security instructions.\n- Minor example and documentation updates for consistency with the new base URL.\n- Removed the LICENSE.txt file.\n\nv1.0.6 | 2026-02-10T20:35:59.017Z | user\n\n- Added clawdbot metadata for skill compatibility and requirements.\n- Declared required environment variable (`MATON_API_KEY`) in the metadata section.\n- No changes to functional documentation or API usage.\n\nv1.0.5 | 2026-02-10T12:35:08.096Z | user\n\n- Simplified the \"Base URL\" section and moved critical prefix instructions up front.\n- Removed redundant instructions and streamlined the authentication and connection setup guides.\n- Clarified troubleshooting steps for API key errors and added troubleshooting for invalid app names.\n- Cleaned up and condensed general notes for easier reference.\n- No API or functionality changes; documentation only.\n\nv1.0.4 | 2026-02-08T01:43:50.743Z | user\n\n- Clarified base URL requirements to specify that all paths must start with the connection app name (e.g., `/google-mail/...`).\n- Added an explicit note emphasizing that the app prefix (such as `/google-mail/`) is required for the gateway to identify the correct connection.\n- No other content changes detected.\n\nv1.0.3 | 2026-02-06T02:17:37.779Z | user\n\n- Switched all shell and cURL examples to Python one-liners using `urllib.request` for easier out-of-the-box use.\n- Added a new Troubleshooting section for \"Invalid API key\" errors, including detailed step-by-step instructions and Python test code.\n- Updated quick start and connection management instructions with Python equivalents.\n- General documentation improvements to streamline getting started and debugging.\n\nv1.0.2 | 2026-02-05T01:37:10.194Z | user\n\n- Added a note in the description recommending the api-gateway skill for integration with third party apps other than Gmail.\n- Updated code samples and curl commands to use environment variable syntax ($MATON_API_KEY) for clarity.\n- Added important notes about using curl with the -g flag for bracketed URLs and about shell variable expansion issues when piping to jq or other commands.\n\nv1.0.1 | 2026-02-03T11:24:45.915Z | user\n\n- Updated base URL documentation: replace `{endpoint}` with `{native-api-path}` for clarity.\n- Expanded connection response example to include `creation_time`, `last_updated_time`, and `metadata` fields.\n- Added instructions for specifying a Gmail connection using the `Maton-Connection` header.\n- Clarified API key acquisition (sign in or create an account).\n- Minor improvements for accuracy and clarity in usage instructions.\n\nv1.0.0 | 2026-02-02T08:31:14.275Z | user\n\n- Initial release of Gmail skill with managed OAuth integration.\n- Supports reading, sending, and managing emails, threads, labels, and drafts via the Gmail API.\n- API key-based authentication through Maton gateway.\n- Includes connection management endpoints and example code in Python and JavaScript.\n- Features comprehensive usage instructions, query operators, and error handling documentation.\n\nArchive index:\n\nArchive v1.0.8: 2 files, 3778 bytes\n\nFiles: SKILL.md (11791b), _meta.json (124b)\n\nFile v1.0.8:SKILL.md\n\n---\nname: gmail\ndescription: |\n  Gmail API integration with managed OAuth. Read, send, and manage emails, threads, labels, and drafts. Use this skill when users want to interact with Gmail. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).\ncompatibility: Requires network access and valid Maton API key\nmetadata:\n  author: maton\n  version: \"1.0\"\n  clawdbot:\n    emoji: 🧠\n    requires:\n      env:\n        - MATON_API_KEY\n---\n\n# Gmail\n\nAccess the Gmail API with managed OAuth authentication. Read, send, and manage emails, threads, labels, and drafts.\n\n## Quick Start\n\n**CLI:**\n\n```bash\nmaton google-mail message list -L 10\n```\n\n```bash\nmaton api '/google-mail/gmail/v1/users/me/messages?maxResults=10'\n```\n\n**Python:**\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://api.maton.ai/google-mail/gmail/v1/users/me/messages?maxResults=10')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n## Base URL\n\n```\nhttps://api.maton.ai/google-mail/{native-api-path}\n```\n\nMaton proxies requests to `gmail.googleapis.com` and automatically injects your OAuth token.\n\n## Installation\n\n**NPM:**\n```bash\nnpm install -g @maton-ai/cli\n```\n\n**Homebrew:**\n```bash\nbrew install maton-ai/cli/maton\n```\n\n## Authentication\n\n**CLI:**\n\n```bash\nmaton login                          # Opens browser for API key\nmaton login --interactive            # Skip browser, paste API key directly\nmaton whoami                         # Show current auth state\n```\n\n**Manual:**\n\n1. Sign in or create an account at [maton.ai](https://maton.ai)\n2. Go to [maton.ai/settings](https://maton.ai/settings)\n3. Copy your API key\n4. Set your API key as `MATON_API_KEY`:\n\n```bash\nexport MATON_API_KEY=\"YOUR_API_KEY\"\n```\n\n## Connection Management\n\nManage your Google OAuth connections at `https://api.maton.ai`.\n\n### List Connections\n\n**CLI:**\n\n```bash\nmaton connection list google-mail --status ACTIVE\n```\n\n```bash\nmaton api -X GET /connections -f app=google-mail -f status=ACTIVE\n```\n\n**Python:**\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://api.maton.ai/connections?app=google-mail&status=ACTIVE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Create Connection\n\n**CLI:**\n\n```bash\nmaton connection create google-mail\n```\n\n```bash\nmaton api /connections -f app=google-mail\n```\n\n**Python:**\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'app': 'google-mail'}).encode()\nreq = urllib.request.Request('https://api.maton.ai/connections', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Get Connection\n\n**CLI:**\n\n```bash\nmaton connection view {connection_id}\n```\n\n```bash\nmaton api /connections/{connection_id}\n```\n\n**Python:**\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://api.maton.ai/connections/{connection_id}')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n**Response:**\n```json\n{\n  \"connection\": {\n    \"connection_id\": \"{connection_id}\",\n    \"status\": \"ACTIVE\",\n    \"creation_time\": \"2025-12-08T07:20:53.488460Z\",\n    \"last_updated_time\": \"2026-01-31T20:03:32.593153Z\",\n    \"url\": \"https://connect.maton.ai/?session_token=...\",\n    \"app\": \"google-mail\",\n    \"metadata\": {}\n  }\n}\n```\n\nOpen the returned `url` in a browser to complete OAuth authorization.\n\n### Delete Connection\n\n**CLI:**\n\n```bash\nmaton connection delete {connection_id}\n```\n\n```bash\nmaton api -X DELETE /connections/{connection_id}\n```\n\n**Python:**\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://api.maton.ai/connections/{connection_id}', method='DELETE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Specifying Connection\n\nIf you have multiple Gmail connections, specify which one to use:\n\n**CLI:**\n\n```bash\nmaton google-mail message list -L 10 --connection {connection_id}\n```\n\n```bash\nmaton api /google-mail/gmail/v1/users/me/messages --connection {connection_id}\n```\n\n**Python:**\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://api.maton.ai/google-mail/gmail/v1/users/me/messages')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Maton-Connection', '{connection_id}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\nIf you have multiple connections, always specify the connection to ensure requests go to the intended account.\n\n## Security & Permissions\n\n- Access is scoped to messages, threads, labels, drafts, and email sending within the connected Gmail account.\n- **All write operations require explicit user approval.** Before executing any create, update, or delete call, confirm the target resource and intended effect with the user.\n\n## API Reference\n\n### List Messages\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages?maxResults=10\n```\n\nExample:\n\n```bash\nmaton google-mail message list -L 10\n```\n\nWith query filter:\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages?q=is:unread&maxResults=10\n```\n\nExample:\n\n```bash\nmaton google-mail message list --query 'is:unread' -L 10\n```\n\n### Get Message\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages/{messageId}\n```\n\nExample:\n\n```bash\nmaton google-mail message view {messageId} --headers\n```\n\nWith metadata only:\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages/{messageId}?format=metadata&metadataHeaders=From&metadataHeaders=Subject&metadataHeaders=Date\n```\n\nExample:\n\n```bash\nmaton google-mail message view {messageId} --fetch-format metadata --metadata-header From,Subject,Date\n```\n\n### Send Message\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/send\nContent-Type: application/json\n\n{\n  \"raw\": \"BASE64_ENCODED_EMAIL\"\n}\n```\n\nExample:\n\n```bash\nmaton google-mail message send --to alice@example.com --subject 'Hello' --body 'Hi there!'\n```\n\n### Reply to Message\n\n```bash\nmaton google-mail message reply {messageId} --body 'Thanks!'\n```\n\n### Forward Message\n\n```bash\nmaton google-mail message forward {messageId} --to dave@example.com --body 'FYI'\n```\n\n### List Labels\n\n```bash\nGET /google-mail/gmail/v1/users/me/labels\n```\n\nExample:\n\n```bash\nmaton google-mail label list\n```\n\n### List Threads\n\n```bash\nGET /google-mail/gmail/v1/users/me/threads?maxResults=10\n```\n\nExample:\n\n```bash\nmaton google-mail thread list -L 10\n```\n\n### Get Thread\n\n```bash\nGET /google-mail/gmail/v1/users/me/threads/{threadId}\n```\n\nExample:\n\n```bash\nmaton google-mail thread view {threadId}\n```\n\n### Modify Message Labels\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/{messageId}/modify\nContent-Type: application/json\n\n{\n  \"addLabelIds\": [\"STARRED\"],\n  \"removeLabelIds\": [\"UNREAD\"]\n}\n```\n\nExample:\n\n```bash\nmaton google-mail message modify {messageId} --add-label STARRED --remove-label UNREAD\n```\n\n### Trash Message\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/{messageId}/trash\n```\n\nExample:\n\n```bash\nmaton google-mail message trash {messageId}\n```\n\n### Create Draft\n\n```bash\nPOST /google-mail/gmail/v1/users/me/drafts\nContent-Type: application/json\n\n{\n  \"message\": {\n    \"raw\": \"BASE64URL_ENCODED_EMAIL\"\n  }\n}\n```\n\nExample:\n\n```bash\nmaton google-mail draft create --to alice@example.com --subject 'Hello' --body 'Draft content here'\n```\n\n### Send Draft\n\n```bash\nPOST /google-mail/gmail/v1/users/me/drafts/send\nContent-Type: application/json\n\n{\n  \"id\": \"{draftId}\"\n}\n```\n\nExample:\n\n```bash\nmaton google-mail draft send {draftId}\n```\n\n### Get Profile\n\n```bash\nGET /google-mail/gmail/v1/users/me/profile\n```\n\n## Query Operators\n\nUse in the `q` parameter:\n- `is:unread` - Unread messages\n- `is:starred` - Starred messages\n- `from:email@example.com` - From specific sender\n- `to:email@example.com` - To specific recipient\n- `subject:keyword` - Subject contains keyword\n- `after:2024/01/01` - After date\n- `before:2024/12/31` - Before date\n- `has:attachment` - Has attachments\n\n## Code Examples\n\n### CLI\n\n```bash\n# List unread messages with headers\nmaton google-mail message list --hydrate\n\n# Filter with jq — e.g., only messages from a specific sender\nmaton google-mail message list -L 20 --query 'from:boss@example.com' --json --jq '.messages[].id'\n\n# List all threads with pagination\nmaton google-mail thread list --paginate --query 'newer_than:7d'\n```\n\n### JavaScript\n\n```javascript\nconst response = await fetch(\n  'https://api.maton.ai/google-mail/gmail/v1/users/me/messages?maxResults=10',\n  {\n    headers: {\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n    }\n  }\n);\n```\n\n### Python\n\n```python\nimport os\nimport requests\n\nresponse = requests.get(\n    'https://api.maton.ai/google-mail/gmail/v1/users/me/messages',\n    headers={'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'},\n    params={'maxResults': 10, 'q': 'is:unread'}\n)\n```\n\n## Notes\n\n- Use `me` as userId for the authenticated user\n- Message body is base64url encoded in the `raw` field\n- Common labels: `INBOX`, `SENT`, `DRAFT`, `STARRED`, `UNREAD`, `TRASH`\n- IMPORTANT: When using curl commands, use `curl -g` when URLs contain brackets (`fields[]`, `sort[]`, `records[]`) to disable glob parsing\n- IMPORTANT: When piping curl output to `jq` or other commands, environment variables like `$MATON_API_KEY` may not expand correctly in some shell environments. You may get \"Invalid API key\" errors when piping.\n\n## Error Handling\n\n| Status | Meaning |\n|--------|---------|\n| 400 | Missing Gmail connection |\n| 401 | Invalid or missing Maton API key |\n| 429 | Rate limited (10 req/sec per account) |\n| 4xx/5xx | Passthrough error from Gmail API |\n\n### Troubleshooting: API Key Issues\n\n**CLI:**\n\n1. Check your auth state:\n\n```bash\nmaton whoami\n```\n\n2. Verify the API key is valid by listing connections:\n\n```bash\nmaton connection list\n```\n\n**Manual:**\n\n1. Check that the `MATON_API_KEY` environment variable is set:\n\n```bash\necho $MATON_API_KEY\n```\n\n2. Verify the API key is valid by listing connections:\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://api.maton.ai/connections')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Troubleshooting: Invalid App Name\n\n1. Ensure your URL path starts with `google-mail`. For example:\n\n- Correct: `https://api.maton.ai/google-mail/gmail/v1/users/me/messages`\n- Incorrect: `https://api.maton.ai/gmail/v1/users/me/messages`\n\n## Resources\n\n- [Gmail API Overview](https://developers.google.com/gmail/api/reference/rest)\n- [List Messages](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/list)\n- [Get Message](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/get)\n- [Send Message](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/send)\n- [List Threads](https://developers.google.com/gmail/api/reference/rest/v1/users.threads/list)\n- [List Labels](https://developers.google.com/gmail/api/reference/rest/v1/users.labels/list)\n- [Create Draft](https://developers.google.com/gmail/api/reference/rest/v1/users.drafts/create)\n- [Maton CLI Manual](https://cli.maton.ai/manual)\n- [Maton Community](https://discord.com/invite/dBfFAcefs2)\n- [Maton Support](mailto:support@maton.ai)\n\nFile v1.0.8:_meta.json\n\n{\n  \"ownerId\": \"kn75240wq8bnv2qm2xgry748jd80b9r0\",\n  \"slug\": \"gmail\",\n  \"version\": \"1.0.8\",\n  \"publishedAt\": 1778148211420\n}\n\nArchive v1.0.7: 2 files, 3189 bytes\n\nFiles: SKILL.md (9027b), _meta.json (124b)\n\nFile v1.0.7:SKILL.md\n\n---\nname: gmail\ndescription: |\n  Gmail API integration with managed OAuth. Read, send, and manage emails, threads, labels, and drafts. Use this skill when users want to interact with Gmail. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).\ncompatibility: Requires network access and valid Maton API key\nmetadata:\n  author: maton\n  version: \"1.0\"\n  clawdbot:\n    emoji: 🧠\n    requires:\n      env:\n        - MATON_API_KEY\n---\n\n# Gmail\n\nAccess the Gmail API with managed OAuth authentication. Read, send, and manage emails, threads, labels, and drafts.\n\n## Quick Start\n\n```bash\n# List messages\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://api.maton.ai/google-mail/gmail/v1/users/me/messages?maxResults=10')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n## Base URL\n\n```\nhttps://api.maton.ai/google-mail/{native-api-path}\n```\n\nOnly the endpoints listed in the API Reference section below are supported. Maton proxies requests to `gmail.googleapis.com` and automatically injects your OAuth token.\n\n## Authentication\n\nAll requests require the Maton API key in the Authorization header:\n\n```\nAuthorization: Bearer $MATON_API_KEY\n```\n\n**Environment Variable:** Set your API key as `MATON_API_KEY`:\n\n```bash\nexport MATON_API_KEY=\"YOUR_API_KEY\"\n```\n\n### Getting Your API Key\n\n1. Sign in or create an account at [maton.ai](https://maton.ai)\n2. Go to [maton.ai/settings](https://maton.ai/settings)\n3. Copy your API key\n\n## Connection Management\n\nManage your Google OAuth connections at `https://api.maton.ai`.\n\n### List Connections\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://api.maton.ai/connections?app=google-mail&status=ACTIVE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Create Connection\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'app': 'google-mail'}).encode()\nreq = urllib.request.Request('https://api.maton.ai/connections', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Get Connection\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://api.maton.ai/connections/{connection_id}')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n**Response:**\n```json\n{\n  \"connection\": {\n    \"connection_id\": \"{connection_id}\",\n    \"status\": \"ACTIVE\",\n    \"creation_time\": \"2025-12-08T07:20:53.488460Z\",\n    \"last_updated_time\": \"2026-01-31T20:03:32.593153Z\",\n    \"url\": \"https://connect.maton.ai/?session_token=...\",\n    \"app\": \"google-mail\",\n    \"metadata\": {}\n  }\n}\n```\n\nOpen the returned `url` in a browser to complete OAuth authorization.\n\n### Delete Connection\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://api.maton.ai/connections/{connection_id}', method='DELETE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Specifying Connection\n\nIf you have multiple Gmail connections, specify which one to use with the `Maton-Connection` header:\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://api.maton.ai/google-mail/gmail/v1/users/me/messages')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Maton-Connection', '{connection_id}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\nIf you have multiple connections, always include this header to ensure requests go to the intended account.\n\n## Security & Permissions\n\n- Access is scoped to messages, threads, labels, drafts, and email sending within the connected Gmail account.\n- **All write operations require explicit user approval.** Before executing any create, update, or delete call, confirm the target resource and intended effect with the user.\n\n## API Reference\n\n### List Messages\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages?maxResults=10\n```\n\nWith query filter:\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages?q=is:unread&maxResults=10\n```\n\n### Get Message\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages/{messageId}\n```\n\nWith metadata only:\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages/{messageId}?format=metadata&metadataHeaders=From&metadataHeaders=Subject&metadataHeaders=Date\n```\n\n### Send Message\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/send\nContent-Type: application/json\n\n{\n  \"raw\": \"BASE64_ENCODED_EMAIL\"\n}\n```\n\n### List Labels\n\n```bash\nGET /google-mail/gmail/v1/users/me/labels\n```\n\n### List Threads\n\n```bash\nGET /google-mail/gmail/v1/users/me/threads?maxResults=10\n```\n\n### Get Thread\n\n```bash\nGET /google-mail/gmail/v1/users/me/threads/{threadId}\n```\n\n### Modify Message Labels\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/{messageId}/modify\nContent-Type: application/json\n\n{\n  \"addLabelIds\": [\"STARRED\"],\n  \"removeLabelIds\": [\"UNREAD\"]\n}\n```\n\n### Trash Message\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/{messageId}/trash\n```\n\n### Create Draft\n\n```bash\nPOST /google-mail/gmail/v1/users/me/drafts\nContent-Type: application/json\n\n{\n  \"message\": {\n    \"raw\": \"BASE64URL_ENCODED_EMAIL\"\n  }\n}\n```\n\n### Send Draft\n\n```bash\nPOST /google-mail/gmail/v1/users/me/drafts/send\nContent-Type: application/json\n\n{\n  \"id\": \"{draftId}\"\n}\n```\n\n### Get Profile\n\n```bash\nGET /google-mail/gmail/v1/users/me/profile\n```\n\n## Query Operators\n\nUse in the `q` parameter:\n- `is:unread` - Unread messages\n- `is:starred` - Starred messages\n- `from:email@example.com` - From specific sender\n- `to:email@example.com` - To specific recipient\n- `subject:keyword` - Subject contains keyword\n- `after:2024/01/01` - After date\n- `before:2024/12/31` - Before date\n- `has:attachment` - Has attachments\n\n## Code Examples\n\n### JavaScript\n\n```javascript\nconst response = await fetch(\n  'https://api.maton.ai/google-mail/gmail/v1/users/me/messages?maxResults=10',\n  {\n    headers: {\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n    }\n  }\n);\n```\n\n### Python\n\n```python\nimport os\nimport requests\n\nresponse = requests.get(\n    'https://api.maton.ai/google-mail/gmail/v1/users/me/messages',\n    headers={'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'},\n    params={'maxResults': 10, 'q': 'is:unread'}\n)\n```\n\n## Notes\n\n- Use `me` as userId for the authenticated user\n- Message body is base64url encoded in the `raw` field\n- Common labels: `INBOX`, `SENT`, `DRAFT`, `STARRED`, `UNREAD`, `TRASH`\n- IMPORTANT: When using curl commands, use `curl -g` when URLs contain brackets (`fields[]`, `sort[]`, `records[]`) to disable glob parsing\n- IMPORTANT: When piping curl output to `jq` or other commands, environment variables like `$MATON_API_KEY` may not expand correctly in some shell environments. You may get \"Invalid API key\" errors when piping.\n\n## Error Handling\n\n| Status | Meaning |\n|--------|---------|\n| 400 | Missing Gmail connection |\n| 401 | Invalid or missing Maton API key |\n| 429 | Rate limited (10 req/sec per account) |\n| 4xx/5xx | Passthrough error from Gmail API |\n\n### Troubleshooting: API Key Issues\n\n1. Check that the `MATON_API_KEY` environment variable is set:\n\n```bash\necho $MATON_API_KEY\n```\n\n2. Verify the API key is valid by listing connections:\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://api.maton.ai/connections')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Troubleshooting: Invalid App Name\n\n1. Ensure your URL path starts with `google-mail`. For example:\n\n- Correct: `https://api.maton.ai/google-mail/gmail/v1/users/me/messages`\n- Incorrect: `https://api.maton.ai/gmail/v1/users/me/messages`\n\n## Resources\n\n- [Gmail API Overview](https://developers.google.com/gmail/api/reference/rest)\n- [List Messages](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/list)\n- [Get Message](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/get)\n- [Send Message](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/send)\n- [List Threads](https://developers.google.com/gmail/api/reference/rest/v1/users.threads/list)\n- [List Labels](https://developers.google.com/gmail/api/reference/rest/v1/users.labels/list)\n- [Create Draft](https://developers.google.com/gmail/api/reference/rest/v1/users.drafts/create)\n- [Maton Community](https://discord.com/invite/dBfFAcefs2)\n- [Maton Support](mailto:support@maton.ai)\n\nFile v1.0.7:_meta.json\n\n{\n  \"ownerId\": \"kn75240wq8bnv2qm2xgry748jd80b9r0\",\n  \"slug\": \"gmail\",\n  \"version\": \"1.0.7\",\n  \"publishedAt\": 1777584350834\n}\n\nArchive v1.0.6: 3 files, 3807 bytes\n\nFiles: LICENSE.txt (1072b), SKILL.md (8749b), _meta.json (124b)\n\nFile v1.0.6:SKILL.md\n\n---\nname: gmail\ndescription: |\n  Gmail API integration with managed OAuth. Read, send, and manage emails, threads, labels, and drafts. Use this skill when users want to interact with Gmail. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).\ncompatibility: Requires network access and valid Maton API key\nmetadata:\n  author: maton\n  version: \"1.0\"\n  clawdbot:\n    emoji: 🧠\n    requires:\n      env:\n        - MATON_API_KEY\n---\n\n# Gmail\n\nAccess the Gmail API with managed OAuth authentication. Read, send, and manage emails, threads, labels, and drafts.\n\n## Quick Start\n\n```bash\n# List messages\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages?maxResults=10')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n## Base URL\n\n```\nhttps://gateway.maton.ai/google-mail/{native-api-path}\n```\n\nReplace `{native-api-path}` with the actual Gmail API endpoint path. The gateway proxies requests to `gmail.googleapis.com` and automatically injects your OAuth token.\n\n## Authentication\n\nAll requests require the Maton API key in the Authorization header:\n\n```\nAuthorization: Bearer $MATON_API_KEY\n```\n\n**Environment Variable:** Set your API key as `MATON_API_KEY`:\n\n```bash\nexport MATON_API_KEY=\"YOUR_API_KEY\"\n```\n\n### Getting Your API Key\n\n1. Sign in or create an account at [maton.ai](https://maton.ai)\n2. Go to [maton.ai/settings](https://maton.ai/settings)\n3. Copy your API key\n\n## Connection Management\n\nManage your Google OAuth connections at `https://ctrl.maton.ai`.\n\n### List Connections\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections?app=google-mail&status=ACTIVE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Create Connection\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'app': 'google-mail'}).encode()\nreq = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Get Connection\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n**Response:**\n```json\n{\n  \"connection\": {\n    \"connection_id\": \"21fd90f9-5935-43cd-b6c8-bde9d915ca80\",\n    \"status\": \"ACTIVE\",\n    \"creation_time\": \"2025-12-08T07:20:53.488460Z\",\n    \"last_updated_time\": \"2026-01-31T20:03:32.593153Z\",\n    \"url\": \"https://connect.maton.ai/?session_token=...\",\n    \"app\": \"google-mail\",\n    \"metadata\": {}\n  }\n}\n```\n\nOpen the returned `url` in a browser to complete OAuth authorization.\n\n### Delete Connection\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Specifying Connection\n\nIf you have multiple Gmail connections, specify which one to use with the `Maton-Connection` header:\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Maton-Connection', '21fd90f9-5935-43cd-b6c8-bde9d915ca80')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\nIf omitted, the gateway uses the default (oldest) active connection.\n\n## API Reference\n\n### List Messages\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages?maxResults=10\n```\n\nWith query filter:\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages?q=is:unread&maxResults=10\n```\n\n### Get Message\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages/{messageId}\n```\n\nWith metadata only:\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages/{messageId}?format=metadata&metadataHeaders=From&metadataHeaders=Subject&metadataHeaders=Date\n```\n\n### Send Message\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/send\nContent-Type: application/json\n\n{\n  \"raw\": \"BASE64_ENCODED_EMAIL\"\n}\n```\n\n### List Labels\n\n```bash\nGET /google-mail/gmail/v1/users/me/labels\n```\n\n### List Threads\n\n```bash\nGET /google-mail/gmail/v1/users/me/threads?maxResults=10\n```\n\n### Get Thread\n\n```bash\nGET /google-mail/gmail/v1/users/me/threads/{threadId}\n```\n\n### Modify Message Labels\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/{messageId}/modify\nContent-Type: application/json\n\n{\n  \"addLabelIds\": [\"STARRED\"],\n  \"removeLabelIds\": [\"UNREAD\"]\n}\n```\n\n### Trash Message\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/{messageId}/trash\n```\n\n### Create Draft\n\n```bash\nPOST /google-mail/gmail/v1/users/me/drafts\nContent-Type: application/json\n\n{\n  \"message\": {\n    \"raw\": \"BASE64URL_ENCODED_EMAIL\"\n  }\n}\n```\n\n### Send Draft\n\n```bash\nPOST /google-mail/gmail/v1/users/me/drafts/send\nContent-Type: application/json\n\n{\n  \"id\": \"{draftId}\"\n}\n```\n\n### Get Profile\n\n```bash\nGET /google-mail/gmail/v1/users/me/profile\n```\n\n## Query Operators\n\nUse in the `q` parameter:\n- `is:unread` - Unread messages\n- `is:starred` - Starred messages\n- `from:email@example.com` - From specific sender\n- `to:email@example.com` - To specific recipient\n- `subject:keyword` - Subject contains keyword\n- `after:2024/01/01` - After date\n- `before:2024/12/31` - Before date\n- `has:attachment` - Has attachments\n\n## Code Examples\n\n### JavaScript\n\n```javascript\nconst response = await fetch(\n  'https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages?maxResults=10',\n  {\n    headers: {\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n    }\n  }\n);\n```\n\n### Python\n\n```python\nimport os\nimport requests\n\nresponse = requests.get(\n    'https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages',\n    headers={'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'},\n    params={'maxResults': 10, 'q': 'is:unread'}\n)\n```\n\n## Notes\n\n- Use `me` as userId for the authenticated user\n- Message body is base64url encoded in the `raw` field\n- Common labels: `INBOX`, `SENT`, `DRAFT`, `STARRED`, `UNREAD`, `TRASH`\n- IMPORTANT: When using curl commands, use `curl -g` when URLs contain brackets (`fields[]`, `sort[]`, `records[]`) to disable glob parsing\n- IMPORTANT: When piping curl output to `jq` or other commands, environment variables like `$MATON_API_KEY` may not expand correctly in some shell environments. You may get \"Invalid API key\" errors when piping.\n\n## Error Handling\n\n| Status | Meaning |\n|--------|---------|\n| 400 | Missing Gmail connection |\n| 401 | Invalid or missing Maton API key |\n| 429 | Rate limited (10 req/sec per account) |\n| 4xx/5xx | Passthrough error from Gmail API |\n\n### Troubleshooting: API Key Issues\n\n1. Check that the `MATON_API_KEY` environment variable is set:\n\n```bash\necho $MATON_API_KEY\n```\n\n2. Verify the API key is valid by listing connections:\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Troubleshooting: Invalid App Name\n\n1. Ensure your URL path starts with `google-mail`. For example:\n\n- Correct: `https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages`\n- Incorrect: `https://gateway.maton.ai/gmail/v1/users/me/messages`\n\n## Resources\n\n- [Gmail API Overview](https://developers.google.com/gmail/api/reference/rest)\n- [List Messages](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/list)\n- [Get Message](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/get)\n- [Send Message](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/send)\n- [List Threads](https://developers.google.com/gmail/api/reference/rest/v1/users.threads/list)\n- [List Labels](https://developers.google.com/gmail/api/reference/rest/v1/users.labels/list)\n- [Create Draft](https://developers.google.com/gmail/api/reference/rest/v1/users.drafts/create)\n- [Maton Community](https://discord.com/invite/dBfFAcefs2)\n- [Maton Support](mailto:support@maton.ai)\n\nFile v1.0.6:_meta.json\n\n{\n  \"ownerId\": \"kn75240wq8bnv2qm2xgry748jd80b9r0\",\n  \"slug\": \"gmail\",\n  \"version\": \"1.0.6\",\n  \"publishedAt\": 1770755759017\n}\n\nFile v1.0.6:LICENSE.txt\n\nThe MIT License (MIT)\n\nCopyright (c) 2026 Maton\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\nArchive v1.0.5: 3 files, 3766 bytes\n\nFiles: LICENSE.txt (1072b), SKILL.md (8672b), _meta.json (124b)\n\nFile v1.0.5:SKILL.md\n\n---\nname: gmail\ndescription: |\n  Gmail API integration with managed OAuth. Read, send, and manage emails, threads, labels, and drafts. Use this skill when users want to interact with Gmail. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).\ncompatibility: Requires network access and valid Maton API key\nmetadata:\n  author: maton\n  version: \"1.0\"\n---\n\n# Gmail\n\nAccess the Gmail API with managed OAuth authentication. Read, send, and manage emails, threads, labels, and drafts.\n\n## Quick Start\n\n```bash\n# List messages\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages?maxResults=10')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n## Base URL\n\n```\nhttps://gateway.maton.ai/google-mail/{native-api-path}\n```\n\nReplace `{native-api-path}` with the actual Gmail API endpoint path. The gateway proxies requests to `gmail.googleapis.com` and automatically injects your OAuth token.\n\n## Authentication\n\nAll requests require the Maton API key in the Authorization header:\n\n```\nAuthorization: Bearer $MATON_API_KEY\n```\n\n**Environment Variable:** Set your API key as `MATON_API_KEY`:\n\n```bash\nexport MATON_API_KEY=\"YOUR_API_KEY\"\n```\n\n### Getting Your API Key\n\n1. Sign in or create an account at [maton.ai](https://maton.ai)\n2. Go to [maton.ai/settings](https://maton.ai/settings)\n3. Copy your API key\n\n## Connection Management\n\nManage your Google OAuth connections at `https://ctrl.maton.ai`.\n\n### List Connections\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections?app=google-mail&status=ACTIVE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Create Connection\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'app': 'google-mail'}).encode()\nreq = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Get Connection\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n**Response:**\n```json\n{\n  \"connection\": {\n    \"connection_id\": \"21fd90f9-5935-43cd-b6c8-bde9d915ca80\",\n    \"status\": \"ACTIVE\",\n    \"creation_time\": \"2025-12-08T07:20:53.488460Z\",\n    \"last_updated_time\": \"2026-01-31T20:03:32.593153Z\",\n    \"url\": \"https://connect.maton.ai/?session_token=...\",\n    \"app\": \"google-mail\",\n    \"metadata\": {}\n  }\n}\n```\n\nOpen the returned `url` in a browser to complete OAuth authorization.\n\n### Delete Connection\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Specifying Connection\n\nIf you have multiple Gmail connections, specify which one to use with the `Maton-Connection` header:\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Maton-Connection', '21fd90f9-5935-43cd-b6c8-bde9d915ca80')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\nIf omitted, the gateway uses the default (oldest) active connection.\n\n## API Reference\n\n### List Messages\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages?maxResults=10\n```\n\nWith query filter:\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages?q=is:unread&maxResults=10\n```\n\n### Get Message\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages/{messageId}\n```\n\nWith metadata only:\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages/{messageId}?format=metadata&metadataHeaders=From&metadataHeaders=Subject&metadataHeaders=Date\n```\n\n### Send Message\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/send\nContent-Type: application/json\n\n{\n  \"raw\": \"BASE64_ENCODED_EMAIL\"\n}\n```\n\n### List Labels\n\n```bash\nGET /google-mail/gmail/v1/users/me/labels\n```\n\n### List Threads\n\n```bash\nGET /google-mail/gmail/v1/users/me/threads?maxResults=10\n```\n\n### Get Thread\n\n```bash\nGET /google-mail/gmail/v1/users/me/threads/{threadId}\n```\n\n### Modify Message Labels\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/{messageId}/modify\nContent-Type: application/json\n\n{\n  \"addLabelIds\": [\"STARRED\"],\n  \"removeLabelIds\": [\"UNREAD\"]\n}\n```\n\n### Trash Message\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/{messageId}/trash\n```\n\n### Create Draft\n\n```bash\nPOST /google-mail/gmail/v1/users/me/drafts\nContent-Type: application/json\n\n{\n  \"message\": {\n    \"raw\": \"BASE64URL_ENCODED_EMAIL\"\n  }\n}\n```\n\n### Send Draft\n\n```bash\nPOST /google-mail/gmail/v1/users/me/drafts/send\nContent-Type: application/json\n\n{\n  \"id\": \"{draftId}\"\n}\n```\n\n### Get Profile\n\n```bash\nGET /google-mail/gmail/v1/users/me/profile\n```\n\n## Query Operators\n\nUse in the `q` parameter:\n- `is:unread` - Unread messages\n- `is:starred` - Starred messages\n- `from:email@example.com` - From specific sender\n- `to:email@example.com` - To specific recipient\n- `subject:keyword` - Subject contains keyword\n- `after:2024/01/01` - After date\n- `before:2024/12/31` - Before date\n- `has:attachment` - Has attachments\n\n## Code Examples\n\n### JavaScript\n\n```javascript\nconst response = await fetch(\n  'https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages?maxResults=10',\n  {\n    headers: {\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n    }\n  }\n);\n```\n\n### Python\n\n```python\nimport os\nimport requests\n\nresponse = requests.get(\n    'https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages',\n    headers={'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'},\n    params={'maxResults': 10, 'q': 'is:unread'}\n)\n```\n\n## Notes\n\n- Use `me` as userId for the authenticated user\n- Message body is base64url encoded in the `raw` field\n- Common labels: `INBOX`, `SENT`, `DRAFT`, `STARRED`, `UNREAD`, `TRASH`\n- IMPORTANT: When using curl commands, use `curl -g` when URLs contain brackets (`fields[]`, `sort[]`, `records[]`) to disable glob parsing\n- IMPORTANT: When piping curl output to `jq` or other commands, environment variables like `$MATON_API_KEY` may not expand correctly in some shell environments. You may get \"Invalid API key\" errors when piping.\n\n## Error Handling\n\n| Status | Meaning |\n|--------|---------|\n| 400 | Missing Gmail connection |\n| 401 | Invalid or missing Maton API key |\n| 429 | Rate limited (10 req/sec per account) |\n| 4xx/5xx | Passthrough error from Gmail API |\n\n### Troubleshooting: API Key Issues\n\n1. Check that the `MATON_API_KEY` environment variable is set:\n\n```bash\necho $MATON_API_KEY\n```\n\n2. Verify the API key is valid by listing connections:\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Troubleshooting: Invalid App Name\n\n1. Ensure your URL path starts with `google-mail`. For example:\n\n- Correct: `https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages`\n- Incorrect: `https://gateway.maton.ai/gmail/v1/users/me/messages`\n\n## Resources\n\n- [Gmail API Overview](https://developers.google.com/gmail/api/reference/rest)\n- [List Messages](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/list)\n- [Get Message](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/get)\n- [Send Message](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/send)\n- [List Threads](https://developers.google.com/gmail/api/reference/rest/v1/users.threads/list)\n- [List Labels](https://developers.google.com/gmail/api/reference/rest/v1/users.labels/list)\n- [Create Draft](https://developers.google.com/gmail/api/reference/rest/v1/users.drafts/create)\n- [Maton Community](https://discord.com/invite/dBfFAcefs2)\n- [Maton Support](mailto:support@maton.ai)\n\nFile v1.0.5:_meta.json\n\n{\n  \"ownerId\": \"kn75240wq8bnv2qm2xgry748jd80b9r0\",\n  \"slug\": \"gmail\",\n  \"version\": \"1.0.5\",\n  \"publishedAt\": 1770726908096\n}\n\nFile v1.0.5:LICENSE.txt\n\nThe MIT License (MIT)\n\nCopyright (c) 2026 Maton\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\nArchive v1.0.4: 3 files, 4021 bytes\n\nFiles: LICENSE.txt (1072b), SKILL.md (9684b), _meta.json (124b)\n\nFile v1.0.4:SKILL.md\n\n---\nname: gmail\ndescription: |\n  Gmail API integration with managed OAuth. Read, send, and manage emails, threads, labels, and drafts. Use this skill when users want to interact with Gmail. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).\ncompatibility: Requires network access and valid Maton API key\nmetadata:\n  author: maton\n  version: \"1.0\"\n---\n\n# Gmail\n\nAccess the Gmail API with managed OAuth authentication. Read, send, and manage emails, threads, labels, and drafts.\n\n## Quick Start\n\n```bash\n# List messages\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages?maxResults=10')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n## Base URL\n\n```\nhttps://gateway.maton.ai/google-mail/{native-api-path}\n```\n\nReplace `{native-api-path}` with the actual Gmail API endpoint path. The gateway proxies requests to `gmail.googleapis.com` and automatically injects your OAuth token.\n\nIMPORTANT: The URL path MUST start with the connection's app name (eg. `/google-mail/...`). This prefix tells the gateway which app connection to use. For example, the native Gmail API path starts with `gmail/v1/`, so full paths look like `/google-mail/gmail/v1/users/me/messages`.\n\n## Authentication\n\nAll requests require the Maton API key in the Authorization header:\n\n```\nAuthorization: Bearer $MATON_API_KEY\n```\n\n**Environment Variable:** Set your API key as `MATON_API_KEY`:\n\n```bash\nexport MATON_API_KEY=\"YOUR_API_KEY\"\n```\n\n### Getting Your API Key\n\n1. Sign in or create an account at [maton.ai](https://maton.ai)\n2. Go to [maton.ai/settings](https://maton.ai/settings)\n3. Copy your API key\n\n## Connection Management\n\nManage your Google OAuth connections at `https://ctrl.maton.ai`.\n\n### List Connections\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections?app=google-mail&status=ACTIVE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Create Connection\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'app': 'google-mail'}).encode()\nreq = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Get Connection\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n**Response:**\n```json\n{\n  \"connection\": {\n    \"connection_id\": \"21fd90f9-5935-43cd-b6c8-bde9d915ca80\",\n    \"status\": \"ACTIVE\",\n    \"creation_time\": \"2025-12-08T07:20:53.488460Z\",\n    \"last_updated_time\": \"2026-01-31T20:03:32.593153Z\",\n    \"url\": \"https://connect.maton.ai/?session_token=...\",\n    \"app\": \"google-mail\",\n    \"metadata\": {}\n  }\n}\n```\n\nOpen the returned `url` in a browser to complete OAuth authorization.\n\n### Delete Connection\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Specifying Connection\n\nIf you have multiple Gmail connections, specify which one to use with the `Maton-Connection` header:\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Maton-Connection', '21fd90f9-5935-43cd-b6c8-bde9d915ca80')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\nIf omitted, the gateway uses the default (oldest) active connection.\n\n## API Reference\n\n### List Messages\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages?maxResults=10\n```\n\nWith query filter:\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages?q=is:unread&maxResults=10\n```\n\n### Get Message\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages/{messageId}\n```\n\nWith metadata only:\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages/{messageId}?format=metadata&metadataHeaders=From&metadataHeaders=Subject&metadataHeaders=Date\n```\n\n### Send Message\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/send\nContent-Type: application/json\n\n{\n  \"raw\": \"BASE64_ENCODED_EMAIL\"\n}\n```\n\n### List Labels\n\n```bash\nGET /google-mail/gmail/v1/users/me/labels\n```\n\n### List Threads\n\n```bash\nGET /google-mail/gmail/v1/users/me/threads?maxResults=10\n```\n\n### Get Thread\n\n```bash\nGET /google-mail/gmail/v1/users/me/threads/{threadId}\n```\n\n### Modify Message Labels\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/{messageId}/modify\nContent-Type: application/json\n\n{\n  \"addLabelIds\": [\"STARRED\"],\n  \"removeLabelIds\": [\"UNREAD\"]\n}\n```\n\n### Trash Message\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/{messageId}/trash\n```\n\n### Create Draft\n\n```bash\nPOST /google-mail/gmail/v1/users/me/drafts\nContent-Type: application/json\n\n{\n  \"message\": {\n    \"raw\": \"BASE64URL_ENCODED_EMAIL\"\n  }\n}\n```\n\n### Send Draft\n\n```bash\nPOST /google-mail/gmail/v1/users/me/drafts/send\nContent-Type: application/json\n\n{\n  \"id\": \"{draftId}\"\n}\n```\n\n### Get Profile\n\n```bash\nGET /google-mail/gmail/v1/users/me/profile\n```\n\n## Query Operators\n\nUse in the `q` parameter:\n- `is:unread` - Unread messages\n- `is:starred` - Starred messages\n- `from:email@example.com` - From specific sender\n- `to:email@example.com` - To specific recipient\n- `subject:keyword` - Subject contains keyword\n- `after:2024/01/01` - After date\n- `before:2024/12/31` - Before date\n- `has:attachment` - Has attachments\n\n## Code Examples\n\n### JavaScript\n\n```javascript\nconst response = await fetch(\n  'https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages?maxResults=10',\n  {\n    headers: {\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n    }\n  }\n);\n```\n\n### Python\n\n```python\nimport os\nimport requests\n\nresponse = requests.get(\n    'https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages',\n    headers={'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'},\n    params={'maxResults': 10, 'q': 'is:unread'}\n)\n```\n\n## Notes\n\n- Use `me` as userId for the authenticated user\n- Message body is base64url encoded in the `raw` field\n- Common labels: `INBOX`, `SENT`, `DRAFT`, `STARRED`, `UNREAD`, `TRASH`\n- IMPORTANT: When using curl commands, use `curl -g` when URLs contain brackets (`fields[]`, `sort[]`, `records[]`) to disable glob parsing\n- IMPORTANT: When piping curl output to `jq` or other commands, environment variables like `$MATON_API_KEY` may not expand correctly in some shell environments. You may get \"Invalid API key\" errors when piping.\n\n## Error Handling\n\n| Status | Meaning |\n|--------|---------|\n| 400 | Missing Gmail connection |\n| 401 | Invalid or missing Maton API key |\n| 429 | Rate limited (10 req/sec per account) |\n| 4xx/5xx | Passthrough error from Gmail API |\n\n### Troubleshooting: Invalid API Key\n\n**When you receive a \"Invalid API key\" error, ALWAYS follow these steps before concluding there is an issue:**\n\n1. Check that the `MATON_API_KEY` environment variable is set:\n\n```bash\necho $MATON_API_KEY\n```\n\n2. Verify the API key is valid by listing connections:\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Troubleshooting: Missing app connection for {app} or Invalid app name: {app}\n\n**When you receive a \"Missing app connection for {app}\" or \"Invalid app name: {app}\" error, check the following:**\n\n1. Verify your URL path starts with the correct app name. The path must begin with `/google-mail/`. For example:\n\n- Correct: `https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages`\n- Incorrect: `https://gateway.maton.ai/gmail/v1/users/me/messages`\n\n2. Ensure you have an active connection for the app. List your connections to verify:\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections?app=google-mail&status=ACTIVE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n3. If no active connection exists, create one and complete the OAuth flow (see [Create Connection](#create-connection)).\n\n## Resources\n\n- [Gmail API Overview](https://developers.google.com/gmail/api/reference/rest)\n- [List Messages](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/list)\n- [Get Message](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/get)\n- [Send Message](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/send)\n- [List Threads](https://developers.google.com/gmail/api/reference/rest/v1/users.threads/list)\n- [List Labels](https://developers.google.com/gmail/api/reference/rest/v1/users.labels/list)\n- [Create Draft](https://developers.google.com/gmail/api/reference/rest/v1/users.drafts/create)\n\nFile v1.0.4:_meta.json\n\n{\n  \"ownerId\": \"kn75240wq8bnv2qm2xgry748jd80b9r0\",\n  \"slug\": \"gmail\",\n  \"version\": \"1.0.4\",\n  \"publishedAt\": 1770515030743\n}\n\nFile v1.0.4:LICENSE.txt\n\nThe MIT License (MIT)\n\nCopyright (c) 2026 Maton\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\nArchive v1.0.3: 3 files, 3707 bytes\n\nFiles: LICENSE.txt (1072b), SKILL.md (8434b), _meta.json (124b)\n\nFile v1.0.3:SKILL.md\n\n---\nname: gmail\ndescription: |\n  Gmail API integration with managed OAuth. Read, send, and manage emails, threads, labels, and drafts. Use this skill when users want to interact with Gmail. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).\ncompatibility: Requires network access and valid Maton API key\nmetadata:\n  author: maton\n  version: \"1.0\"\n---\n\n# Gmail\n\nAccess the Gmail API with managed OAuth authentication. Read, send, and manage emails, threads, labels, and drafts.\n\n## Quick Start\n\n```bash\n# List messages\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages?maxResults=10')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n## Base URL\n\n```\nhttps://gateway.maton.ai/google-mail/{native-api-path}\n```\n\nReplace `{native-api-path}` with the actual Gmail API endpoint path. The gateway proxies requests to `gmail.googleapis.com` and automatically injects your OAuth token.\n\n## Authentication\n\nAll requests require the Maton API key in the Authorization header:\n\n```\nAuthorization: Bearer $MATON_API_KEY\n```\n\n**Environment Variable:** Set your API key as `MATON_API_KEY`:\n\n```bash\nexport MATON_API_KEY=\"YOUR_API_KEY\"\n```\n\n### Getting Your API Key\n\n1. Sign in or create an account at [maton.ai](https://maton.ai)\n2. Go to [maton.ai/settings](https://maton.ai/settings)\n3. Copy your API key\n\n## Connection Management\n\nManage your Google OAuth connections at `https://ctrl.maton.ai`.\n\n### List Connections\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections?app=google-mail&status=ACTIVE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Create Connection\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'app': 'google-mail'}).encode()\nreq = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Get Connection\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n**Response:**\n```json\n{\n  \"connection\": {\n    \"connection_id\": \"21fd90f9-5935-43cd-b6c8-bde9d915ca80\",\n    \"status\": \"ACTIVE\",\n    \"creation_time\": \"2025-12-08T07:20:53.488460Z\",\n    \"last_updated_time\": \"2026-01-31T20:03:32.593153Z\",\n    \"url\": \"https://connect.maton.ai/?session_token=...\",\n    \"app\": \"google-mail\",\n    \"metadata\": {}\n  }\n}\n```\n\nOpen the returned `url` in a browser to complete OAuth authorization.\n\n### Delete Connection\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Specifying Connection\n\nIf you have multiple Gmail connections, specify which one to use with the `Maton-Connection` header:\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Maton-Connection', '21fd90f9-5935-43cd-b6c8-bde9d915ca80')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\nIf omitted, the gateway uses the default (oldest) active connection.\n\n## API Reference\n\n### List Messages\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages?maxResults=10\n```\n\nWith query filter:\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages?q=is:unread&maxResults=10\n```\n\n### Get Message\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages/{messageId}\n```\n\nWith metadata only:\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages/{messageId}?format=metadata&metadataHeaders=From&metadataHeaders=Subject&metadataHeaders=Date\n```\n\n### Send Message\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/send\nContent-Type: application/json\n\n{\n  \"raw\": \"BASE64_ENCODED_EMAIL\"\n}\n```\n\n### List Labels\n\n```bash\nGET /google-mail/gmail/v1/users/me/labels\n```\n\n### List Threads\n\n```bash\nGET /google-mail/gmail/v1/users/me/threads?maxResults=10\n```\n\n### Get Thread\n\n```bash\nGET /google-mail/gmail/v1/users/me/threads/{threadId}\n```\n\n### Modify Message Labels\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/{messageId}/modify\nContent-Type: application/json\n\n{\n  \"addLabelIds\": [\"STARRED\"],\n  \"removeLabelIds\": [\"UNREAD\"]\n}\n```\n\n### Trash Message\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/{messageId}/trash\n```\n\n### Create Draft\n\n```bash\nPOST /google-mail/gmail/v1/users/me/drafts\nContent-Type: application/json\n\n{\n  \"message\": {\n    \"raw\": \"BASE64URL_ENCODED_EMAIL\"\n  }\n}\n```\n\n### Send Draft\n\n```bash\nPOST /google-mail/gmail/v1/users/me/drafts/send\nContent-Type: application/json\n\n{\n  \"id\": \"{draftId}\"\n}\n```\n\n### Get Profile\n\n```bash\nGET /google-mail/gmail/v1/users/me/profile\n```\n\n## Query Operators\n\nUse in the `q` parameter:\n- `is:unread` - Unread messages\n- `is:starred` - Starred messages\n- `from:email@example.com` - From specific sender\n- `to:email@example.com` - To specific recipient\n- `subject:keyword` - Subject contains keyword\n- `after:2024/01/01` - After date\n- `before:2024/12/31` - Before date\n- `has:attachment` - Has attachments\n\n## Code Examples\n\n### JavaScript\n\n```javascript\nconst response = await fetch(\n  'https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages?maxResults=10',\n  {\n    headers: {\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n    }\n  }\n);\n```\n\n### Python\n\n```python\nimport os\nimport requests\n\nresponse = requests.get(\n    'https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages',\n    headers={'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'},\n    params={'maxResults': 10, 'q': 'is:unread'}\n)\n```\n\n## Notes\n\n- Use `me` as userId for the authenticated user\n- Message body is base64url encoded in the `raw` field\n- Common labels: `INBOX`, `SENT`, `DRAFT`, `STARRED`, `UNREAD`, `TRASH`\n- IMPORTANT: When using curl commands, use `curl -g` when URLs contain brackets (`fields[]`, `sort[]`, `records[]`) to disable glob parsing\n- IMPORTANT: When piping curl output to `jq` or other commands, environment variables like `$MATON_API_KEY` may not expand correctly in some shell environments. You may get \"Invalid API key\" errors when piping.\n\n## Error Handling\n\n| Status | Meaning |\n|--------|---------|\n| 400 | Missing Gmail connection |\n| 401 | Invalid or missing Maton API key |\n| 429 | Rate limited (10 req/sec per account) |\n| 4xx/5xx | Passthrough error from Gmail API |\n\n### Troubleshooting: Invalid API Key\n\n**When you receive a \"Invalid API key\" error, ALWAYS follow these steps before concluding there is an issue:**\n\n1. Check that the `MATON_API_KEY` environment variable is set:\n\n```bash\necho $MATON_API_KEY\n```\n\n2. Verify the API key is valid by listing connections:\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n## Resources\n\n- [Gmail API Overview](https://developers.google.com/gmail/api/reference/rest)\n- [List Messages](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/list)\n- [Get Message](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/get)\n- [Send Message](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/send)\n- [List Threads](https://developers.google.com/gmail/api/reference/rest/v1/users.threads/list)\n- [List Labels](https://developers.google.com/gmail/api/reference/rest/v1/users.labels/list)\n- [Create Draft](https://developers.google.com/gmail/api/reference/rest/v1/users.drafts/create)\n\nFile v1.0.3:_meta.json\n\n{\n  \"ownerId\": \"kn75240wq8bnv2qm2xgry748jd80b9r0\",\n  \"slug\": \"gmail\",\n  \"version\": \"1.0.3\",\n  \"publishedAt\": 1770344257779\n}\n\nFile v1.0.3:LICENSE.txt\n\nThe MIT License (MIT)\n\nCopyright (c) 2026 Maton\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\nArchive v1.0.2: 3 files, 3434 bytes\n\nFiles: LICENSE.txt (1072b), SKILL.md (6778b), _meta.json (124b)\n\nFile v1.0.2:SKILL.md\n\n---\nname: gmail\ndescription: |\n  Gmail API integration with managed OAuth. Read, send, and manage emails, threads, labels, and drafts. Use this skill when users want to interact with Gmail. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).\ncompatibility: Requires network access and valid Maton API key\nmetadata:\n  author: maton\n  version: \"1.0\"\n---\n\n# Gmail\n\nAccess the Gmail API with managed OAuth authentication. Read, send, and manage emails, threads, labels, and drafts.\n\n## Quick Start\n\n```bash\n# List messages\ncurl -s -X GET \"https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages?maxResults=10\" -H \"Authorization: Bearer $MATON_API_KEY\"\n```\n\n## Base URL\n\n```\nhttps://gateway.maton.ai/google-mail/{native-api-path}\n```\n\nReplace `{native-api-path}` with the actual Gmail API endpoint path. The gateway proxies requests to `gmail.googleapis.com` and automatically injects your OAuth token.\n\n## Authentication\n\nAll requests require the Maton API key in the Authorization header:\n\n```\nAuthorization: Bearer $MATON_API_KEY\n```\n\n**Environment Variable:** Set your API key as `MATON_API_KEY`:\n\n```bash\nexport MATON_API_KEY=\"YOUR_API_KEY\"\n```\n\n### Getting Your API Key\n\n1. Sign in or create an account at [maton.ai](https://maton.ai)\n2. Go to [maton.ai/settings](https://maton.ai/settings)\n3. Copy your API key\n\n## Connection Management\n\nManage your Google OAuth connections at `https://ctrl.maton.ai`.\n\n### List Connections\n\n```bash\ncurl -s -X GET \"https://ctrl.maton.ai/connections?app=google-mail&status=ACTIVE\" -H \"Authorization: Bearer $MATON_API_KEY\"\n```\n\n### Create Connection\n\n```bash\ncurl -s -X POST \"https://ctrl.maton.ai/connections\" -H \"Content-Type: application/json\" -H \"Authorization: Bearer $MATON_API_KEY\" -d '{\"app\": \"google-mail\"}'\n```\n\n### Get Connection\n\n```bash\ncurl -s -X GET \"https://ctrl.maton.ai/connections/{connection_id}\" -H \"Authorization: Bearer $MATON_API_KEY\"\n```\n\n**Response:**\n```json\n{\n  \"connection\": {\n    \"connection_id\": \"21fd90f9-5935-43cd-b6c8-bde9d915ca80\",\n    \"status\": \"ACTIVE\",\n    \"creation_time\": \"2025-12-08T07:20:53.488460Z\",\n    \"last_updated_time\": \"2026-01-31T20:03:32.593153Z\",\n    \"url\": \"https://connect.maton.ai/?session_token=...\",\n    \"app\": \"google-mail\",\n    \"metadata\": {}\n  }\n}\n```\n\nOpen the returned `url` in a browser to complete OAuth authorization.\n\n### Delete Connection\n\n```bash\ncurl -s -X DELETE \"https://ctrl.maton.ai/connections/{connection_id}\" -H \"Authorization: Bearer $MATON_API_KEY\"\n```\n\n### Specifying Connection\n\nIf you have multiple Gmail connections, specify which one to use with the `Maton-Connection` header:\n\n```bash\ncurl -s -X GET \"https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages\" -H \"Authorization: Bearer $MATON_API_KEY\" -H \"Maton-Connection: 21fd90f9-5935-43cd-b6c8-bde9d915ca80\"\n```\n\nIf omitted, the gateway uses the default (oldest) active connection.\n\n## API Reference\n\n### List Messages\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages?maxResults=10\n```\n\nWith query filter:\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages?q=is:unread&maxResults=10\n```\n\n### Get Message\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages/{messageId}\n```\n\nWith metadata only:\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages/{messageId}?format=metadata&metadataHeaders=From&metadataHeaders=Subject&metadataHeaders=Date\n```\n\n### Send Message\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/send\nContent-Type: application/json\n\n{\n  \"raw\": \"BASE64_ENCODED_EMAIL\"\n}\n```\n\n### List Labels\n\n```bash\nGET /google-mail/gmail/v1/users/me/labels\n```\n\n### List Threads\n\n```bash\nGET /google-mail/gmail/v1/users/me/threads?maxResults=10\n```\n\n### Get Thread\n\n```bash\nGET /google-mail/gmail/v1/users/me/threads/{threadId}\n```\n\n### Modify Message Labels\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/{messageId}/modify\nContent-Type: application/json\n\n{\n  \"addLabelIds\": [\"STARRED\"],\n  \"removeLabelIds\": [\"UNREAD\"]\n}\n```\n\n### Trash Message\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/{messageId}/trash\n```\n\n### Create Draft\n\n```bash\nPOST /google-mail/gmail/v1/users/me/drafts\nContent-Type: application/json\n\n{\n  \"message\": {\n    \"raw\": \"BASE64URL_ENCODED_EMAIL\"\n  }\n}\n```\n\n### Send Draft\n\n```bash\nPOST /google-mail/gmail/v1/users/me/drafts/send\nContent-Type: application/json\n\n{\n  \"id\": \"{draftId}\"\n}\n```\n\n### Get Profile\n\n```bash\nGET /google-mail/gmail/v1/users/me/profile\n```\n\n## Query Operators\n\nUse in the `q` parameter:\n- `is:unread` - Unread messages\n- `is:starred` - Starred messages\n- `from:email@example.com` - From specific sender\n- `to:email@example.com` - To specific recipient\n- `subject:keyword` - Subject contains keyword\n- `after:2024/01/01` - After date\n- `before:2024/12/31` - Before date\n- `has:attachment` - Has attachments\n\n## Code Examples\n\n### JavaScript\n\n```javascript\nconst response = await fetch(\n  'https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages?maxResults=10',\n  {\n    headers: {\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n    }\n  }\n);\n```\n\n### Python\n\n```python\nimport os\nimport requests\n\nresponse = requests.get(\n    'https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages',\n    headers={'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'},\n    params={'maxResults': 10, 'q': 'is:unread'}\n)\n```\n\n## Notes\n\n- Use `me` as userId for the authenticated user\n- Message body is base64url encoded in the `raw` field\n- Common labels: `INBOX`, `SENT`, `DRAFT`, `STARRED`, `UNREAD`, `TRASH`\n- IMPORTANT: When using curl commands, use `curl -g` when URLs contain brackets (`fields[]`, `sort[]`, `records[]`) to disable glob parsing\n- IMPORTANT: When piping curl output to `jq` or other commands, environment variables like `$MATON_API_KEY` may not expand correctly in some shell environments. You may get \"Invalid API key\" errors when piping.\n\n## Error Handling\n\n| Status | Meaning |\n|--------|---------|\n| 400 | Missing Gmail connection |\n| 401 | Invalid or missing Maton API key |\n| 429 | Rate limited (10 req/sec per account) |\n| 4xx/5xx | Passthrough error from Gmail API |\n\n## Resources\n\n- [Gmail API Overview](https://developers.google.com/gmail/api/reference/rest)\n- [List Messages](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/list)\n- [Get Message](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/get)\n- [Send Message](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/send)\n- [List Threads](https://developers.google.com/gmail/api/reference/rest/v1/users.threads/list)\n- [List Labels](https://developers.google.com/gmail/api/reference/rest/v1/users.labels/list)\n- [Create Draft](https://developers.google.com/gmail/api/reference/rest/v1/users.drafts/create)\n\nFile v1.0.2:_meta.json\n\n{\n  \"ownerId\": \"kn75240wq8bnv2qm2xgry748jd80b9r0\",\n  \"slug\": \"gmail\",\n  \"version\": \"1.0.2\",\n  \"publishedAt\": 1770255430194\n}\n\nFile v1.0.2:LICENSE.txt\n\nThe MIT License (MIT)\n\nCopyright (c) 2026 Maton\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\nArchive v1.0.1: 3 files, 3218 bytes\n\nFiles: LICENSE.txt (1072b), SKILL.md (6352b), _meta.json (124b)\n\nFile v1.0.1:SKILL.md\n\n---\nname: gmail\ndescription: |\n  Gmail API integration with managed OAuth. Read, send, and manage emails, threads, labels, and drafts. Use this skill when users want to interact with Gmail.\ncompatibility: Requires network access and valid Maton API key\nmetadata:\n  author: maton\n  version: \"1.0\"\n---\n\n# Gmail\n\nAccess the Gmail API with managed OAuth authentication. Read, send, and manage emails, threads, labels, and drafts.\n\n## Quick Start\n\n```bash\n# List messages\ncurl -s -X GET 'https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages?maxResults=10' \\\n  -H 'Authorization: Bearer YOUR_API_KEY'\n```\n\n## Base URL\n\n```\nhttps://gateway.maton.ai/google-mail/{native-api-path}\n```\n\nReplace `{native-api-path}` with the actual Gmail API endpoint path. The gateway proxies requests to `gmail.googleapis.com` and automatically injects your OAuth token.\n\n## Authentication\n\nAll requests require the Maton API key in the Authorization header:\n\n```\nAuthorization: Bearer YOUR_API_KEY\n```\n\n**Environment Variable:** Set your API key as `MATON_API_KEY`:\n\n```bash\nexport MATON_API_KEY=\"YOUR_API_KEY\"\n```\n\n### Getting Your API Key\n\n1. Sign in or create an account at [maton.ai](https://maton.ai)\n2. Go to [maton.ai/settings](https://maton.ai/settings)\n3. Copy your API key\n\n## Connection Management\n\nManage your Google OAuth connections at `https://ctrl.maton.ai`.\n\n### List Connections\n\n```bash\ncurl -s -X GET 'https://ctrl.maton.ai/connections?app=google-mail&status=ACTIVE' \\\n  -H 'Authorization: Bearer YOUR_API_KEY'\n```\n\n### Create Connection\n\n```bash\ncurl -s -X POST 'https://ctrl.maton.ai/connections' \\\n  -H 'Content-Type: application/json' \\\n  -H 'Authorization: Bearer YOUR_API_KEY' \\\n  -d '{\"app\": \"google-mail\"}'\n```\n\n### Get Connection\n\n```bash\ncurl -s -X GET 'https://ctrl.maton.ai/connections/{connection_id}' \\\n  -H 'Authorization: Bearer YOUR_API_KEY'\n```\n\n**Response:**\n```json\n{\n  \"connection\": {\n    \"connection_id\": \"21fd90f9-5935-43cd-b6c8-bde9d915ca80\",\n    \"status\": \"ACTIVE\",\n    \"creation_time\": \"2025-12-08T07:20:53.488460Z\",\n    \"last_updated_time\": \"2026-01-31T20:03:32.593153Z\",\n    \"url\": \"https://connect.maton.ai/?session_token=...\",\n    \"app\": \"google-mail\",\n    \"metadata\": {}\n  }\n}\n```\n\nOpen the returned `url` in a browser to complete OAuth authorization.\n\n### Delete Connection\n\n```bash\ncurl -s -X DELETE 'https://ctrl.maton.ai/connections/{connection_id}' \\\n  -H 'Authorization: Bearer YOUR_API_KEY'\n```\n\n### Specifying Connection\n\nIf you have multiple Gmail connections, specify which one to use with the `Maton-Connection` header:\n\n```bash\ncurl -s -X GET 'https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages' \\\n  -H 'Authorization: Bearer YOUR_API_KEY' \\\n  -H 'Maton-Connection: 21fd90f9-5935-43cd-b6c8-bde9d915ca80'\n```\n\nIf omitted, the gateway uses the default (oldest) active connection.\n\n## API Reference\n\n### List Messages\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages?maxResults=10\n```\n\nWith query filter:\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages?q=is:unread&maxResults=10\n```\n\n### Get Message\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages/{messageId}\n```\n\nWith metadata only:\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages/{messageId}?format=metadata&metadataHeaders=From&metadataHeaders=Subject&metadataHeaders=Date\n```\n\n### Send Message\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/send\nContent-Type: application/json\n\n{\n  \"raw\": \"BASE64_ENCODED_EMAIL\"\n}\n```\n\n### List Labels\n\n```bash\nGET /google-mail/gmail/v1/users/me/labels\n```\n\n### List Threads\n\n```bash\nGET /google-mail/gmail/v1/users/me/threads?maxResults=10\n```\n\n### Get Thread\n\n```bash\nGET /google-mail/gmail/v1/users/me/threads/{threadId}\n```\n\n### Modify Message Labels\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/{messageId}/modify\nContent-Type: application/json\n\n{\n  \"addLabelIds\": [\"STARRED\"],\n  \"removeLabelIds\": [\"UNREAD\"]\n}\n```\n\n### Trash Message\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/{messageId}/trash\n```\n\n### Create Draft\n\n```bash\nPOST /google-mail/gmail/v1/users/me/drafts\nContent-Type: application/json\n\n{\n  \"message\": {\n    \"raw\": \"BASE64URL_ENCODED_EMAIL\"\n  }\n}\n```\n\n### Send Draft\n\n```bash\nPOST /google-mail/gmail/v1/users/me/drafts/send\nContent-Type: application/json\n\n{\n  \"id\": \"{draftId}\"\n}\n```\n\n### Get Profile\n\n```bash\nGET /google-mail/gmail/v1/users/me/profile\n```\n\n## Query Operators\n\nUse in the `q` parameter:\n- `is:unread` - Unread messages\n- `is:starred` - Starred messages\n- `from:email@example.com` - From specific sender\n- `to:email@example.com` - To specific recipient\n- `subject:keyword` - Subject contains keyword\n- `after:2024/01/01` - After date\n- `before:2024/12/31` - Before date\n- `has:attachment` - Has attachments\n\n## Code Examples\n\n### JavaScript\n\n```javascript\nconst response = await fetch(\n  'https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages?maxResults=10',\n  {\n    headers: {\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n    }\n  }\n);\n```\n\n### Python\n\n```python\nimport os\nimport requests\n\nresponse = requests.get(\n    'https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages',\n    headers={'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'},\n    params={'maxResults': 10, 'q': 'is:unread'}\n)\n```\n\n## Notes\n\n- Use `me` as userId for the authenticated user\n- Message body is base64url encoded in the `raw` field\n- Common labels: `INBOX`, `SENT`, `DRAFT`, `STARRED`, `UNREAD`, `TRASH`\n\n## Error Handling\n\n| Status | Meaning |\n|--------|---------|\n| 400 | Missing Gmail connection |\n| 401 | Invalid or missing Maton API key |\n| 429 | Rate limited (10 req/sec per account) |\n| 4xx/5xx | Passthrough error from Gmail API |\n\n## Resources\n\n- [Gmail API Overview](https://developers.google.com/gmail/api/reference/rest)\n- [List Messages](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/list)\n- [Get Message](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/get)\n- [Send Message](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/send)\n- [List Threads](https://developers.google.com/gmail/api/reference/rest/v1/users.threads/list)\n- [List Labels](https://developers.google.com/gmail/api/reference/rest/v1/users.labels/list)\n- [Create Draft](https://developers.google.com/gmail/api/reference/rest/v1/users.drafts/create)\n\nFile v1.0.1:_meta.json\n\n{\n  \"ownerId\": \"kn75240wq8bnv2qm2xgry748jd80b9r0\",\n  \"slug\": \"gmail\",\n  \"version\": \"1.0.1\",\n  \"publishedAt\": 1770117885915\n}\n\nFile v1.0.1:LICENSE.txt\n\nThe MIT License (MIT)\n\nCopyright (c) 2026 Maton\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\nArchive v1.0.0: 3 files, 2990 bytes\n\nFiles: LICENSE.txt (1072b), SKILL.md (5744b), _meta.json (124b)\n\nFile v1.0.0:SKILL.md\n\n---\nname: gmail\ndescription: |\n  Gmail API integration with managed OAuth. Read, send, and manage emails, threads, labels, and drafts. Use this skill when users want to interact with Gmail.\ncompatibility: Requires network access and valid Maton API key\nmetadata:\n  author: maton\n  version: \"1.0\"\n---\n\n# Gmail\n\nAccess the Gmail API with managed OAuth authentication. Read, send, and manage emails, threads, labels, and drafts.\n\n## Quick Start\n\n```bash\n# List messages\ncurl -s -X GET 'https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages?maxResults=10' \\\n  -H 'Authorization: Bearer YOUR_API_KEY'\n```\n\n## Base URL\n\n```\nhttps://gateway.maton.ai/google-mail/gmail/v1/users/me/{endpoint}\n```\n\nThe gateway proxies requests to `gmail.googleapis.com` and automatically injects your OAuth token.\n\n## Authentication\n\nAll requests require the Maton API key in the Authorization header:\n\n```\nAuthorization: Bearer YOUR_API_KEY\n```\n\n**Environment Variable:** Set your API key as `MATON_API_KEY`:\n\n```bash\nexport MATON_API_KEY=\"YOUR_API_KEY\"\n```\n\n### Getting Your API Key\n\n1. Sign in at [maton.ai](https://maton.ai)\n2. Go to [maton.ai/settings](https://maton.ai/settings)\n3. Copy your API key\n\n## Connection Management\n\nManage your Google OAuth connections at `https://ctrl.maton.ai`.\n\n### List Connections\n\n```bash\ncurl -s -X GET 'https://ctrl.maton.ai/connections?app=google-mail&status=ACTIVE' \\\n  -H 'Authorization: Bearer YOUR_API_KEY'\n```\n\n### Create Connection\n\n```bash\ncurl -s -X POST 'https://ctrl.maton.ai/connections' \\\n  -H 'Content-Type: application/json' \\\n  -H 'Authorization: Bearer YOUR_API_KEY' \\\n  -d '{\"app\": \"google-mail\"}'\n```\n\n### Get Connection\n\n```bash\ncurl -s -X GET 'https://ctrl.maton.ai/connections/{connection_id}' \\\n  -H 'Authorization: Bearer YOUR_API_KEY'\n```\n\n**Response:**\n```json\n{\n  \"connection\": {\n    \"connection_id\": \"21fd90f9-5935-43cd-b6c8-bde9d915ca80\",\n    \"status\": \"ACTIVE\",\n    \"url\": \"https://connect.maton.ai/?session_token=...\",\n    \"app\": \"google-mail\"\n  }\n}\n```\n\nOpen the returned `url` in a browser to complete OAuth authorization.\n\n### Delete Connection\n\n```bash\ncurl -s -X DELETE 'https://ctrl.maton.ai/connections/{connection_id}' \\\n  -H 'Authorization: Bearer YOUR_API_KEY'\n```\n\n## API Reference\n\n### List Messages\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages?maxResults=10\n```\n\nWith query filter:\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages?q=is:unread&maxResults=10\n```\n\n### Get Message\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages/{messageId}\n```\n\nWith metadata only:\n\n```bash\nGET /google-mail/gmail/v1/users/me/messages/{messageId}?format=metadata&metadataHeaders=From&metadataHeaders=Subject&metadataHeaders=Date\n```\n\n### Send Message\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/send\nContent-Type: application/json\n\n{\n  \"raw\": \"BASE64_ENCODED_EMAIL\"\n}\n```\n\n### List Labels\n\n```bash\nGET /google-mail/gmail/v1/users/me/labels\n```\n\n### List Threads\n\n```bash\nGET /google-mail/gmail/v1/users/me/threads?maxResults=10\n```\n\n### Get Thread\n\n```bash\nGET /google-mail/gmail/v1/users/me/threads/{threadId}\n```\n\n### Modify Message Labels\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/{messageId}/modify\nContent-Type: application/json\n\n{\n  \"addLabelIds\": [\"STARRED\"],\n  \"removeLabelIds\": [\"UNREAD\"]\n}\n```\n\n### Trash Message\n\n```bash\nPOST /google-mail/gmail/v1/users/me/messages/{messageId}/trash\n```\n\n### Create Draft\n\n```bash\nPOST /google-mail/gmail/v1/users/me/drafts\nContent-Type: application/json\n\n{\n  \"message\": {\n    \"raw\": \"BASE64URL_ENCODED_EMAIL\"\n  }\n}\n```\n\n### Send Draft\n\n```bash\nPOST /google-mail/gmail/v1/users/me/drafts/send\nContent-Type: application/json\n\n{\n  \"id\": \"{draftId}\"\n}\n```\n\n### Get Profile\n\n```bash\nGET /google-mail/gmail/v1/users/me/profile\n```\n\n## Query Operators\n\nUse in the `q` parameter:\n- `is:unread` - Unread messages\n- `is:starred` - Starred messages\n- `from:email@example.com` - From specific sender\n- `to:email@example.com` - To specific recipient\n- `subject:keyword` - Subject contains keyword\n- `after:2024/01/01` - After date\n- `before:2024/12/31` - Before date\n- `has:attachment` - Has attachments\n\n## Code Examples\n\n### JavaScript\n\n```javascript\nconst response = await fetch(\n  'https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages?maxResults=10',\n  {\n    headers: {\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n    }\n  }\n);\n```\n\n### Python\n\n```python\nimport os\nimport requests\n\nresponse = requests.get(\n    'https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages',\n    headers={'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'},\n    params={'maxResults': 10, 'q': 'is:unread'}\n)\n```\n\n## Notes\n\n- Use `me` as userId for the authenticated user\n- Message body is base64url encoded in the `raw` field\n- Common labels: `INBOX`, `SENT`, `DRAFT`, `STARRED`, `UNREAD`, `TRASH`\n\n## Error Handling\n\n| Status | Meaning |\n|--------|---------|\n| 400 | Missing Gmail connection |\n| 401 | Invalid or missing Maton API key |\n| 429 | Rate limited (10 req/sec per account) |\n| 4xx/5xx | Passthrough error from Gmail API |\n\n## Resources\n\n- [Gmail API Overview](https://developers.google.com/gmail/api/reference/rest)\n- [List Messages](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/list)\n- [Get Message](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/get)\n- [Send Message](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/send)\n- [List Threads](https://developers.google.com/gmail/api/reference/rest/v1/users.threads/list)\n- [List Labels](https://developers.google.com/gmail/api/reference/rest/v1/users.labels/list)\n- [Create Draft](https://developers.google.com/gmail/api/reference/rest/v1/users.drafts/create)\n\nFile v1.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn75240wq8bnv2qm2xgry748jd80b9r0\",\n  \"slug\": \"gmail\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1770021074275\n}\n\nFile v1.0.0:LICENSE.txt\n\nThe MIT License (MIT)\n\nCopyright (c) 2026 Maton\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","readmeExcerpt":"Skill: Gmail Owner: byungkyu Summary: Gmail API integration with managed OAuth. Read, send, and manage emails, threads, labels, and drafts. Use this skill when users want to interact with Gmail.... Tags: latest:1.0.8 Version history: v1.0.8 | 2026-05-07T10:03:31.420Z | user - Added CLI usage examples throughout documentation for common Gmail operations. - Included installation instructions for Maton CLI via NPM and H","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"maton google-mail message list -L 10"},{"language":"bash","snippet":"maton api '/google-mail/gmail/v1/users/me/messages?maxResults=10'"},{"language":"bash","snippet":"python <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://api.maton.ai/google-mail/gmail/v1/users/me/messages?maxResults=10')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"},{"language":"text","snippet":"https://api.maton.ai/google-mail/{native-api-path}"},{"language":"bash","snippet":"npm install -g @maton-ai/cli"},{"language":"bash","snippet":"brew install maton-ai/cli/maton"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: gmail\ndescription: |\n  Gmail API integration with managed OAuth. Read, send, and manage emails, threads, labels, and drafts. Use this skill when users want to interact with Gmail. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).\ncompatibility: Requires network access and valid Maton API key\nmetadata:\n  author: maton\n  version: \"1.0\"\n  clawdbot:\n    emoji: 🧠\n    requires:\n      env:\n        - MATON_API_KEY\n---\n\n# Gmail\n\nAccess the Gmail API with managed OAuth authentication. Read, send, and manage emails, threads, labels, and drafts.\n\n## Quick Start\n\n**CLI:**\n\n```bash\nmaton google-mail message list -L 10\n```\n\n```bash\nmaton api '/google-mail/gmail/v1/users/me/messages?maxResults=10'\n```\n\n**Python:**\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://api.maton.ai/google-mail/gmail/v1/users/me/messages?maxResults=10')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n## Base URL\n\n```\nhttps://api.maton.ai/google-mail/{native-api-path}\n```\n\nMaton proxies requests to `gmail.googleapis.com` and automatically injects your OAuth token.\n\n## Installation\n\n**NPM:**\n```bash\nnpm install -g @maton-ai/cli\n```\n\n**Homebrew:**\n```bash\nbrew install maton-ai/cli/maton\n```\n\n## Authentication\n\n**CLI:**\n\n```bash\nmaton login                          # Opens browser for API key\nmaton login --interactive            # Skip browser, paste API key directly\nmaton whoami                         # Show current auth state\n```\n\n**Manual:**\n\n1. Sign in or create an account at [maton.ai](https://maton.ai)\n2. Go to [maton.ai/settings](https://maton.ai/settings)\n3. Copy your API key\n4. Set your API key as `MATON_API_KEY`:\n\n```bash\nexport MATON_API_KEY=\"YOUR_API_KEY\"\n```\n\n## Connection Management\n\nManage your Google OAuth connections at `https://api.maton.ai`.\n\n### List Connections\n\n**CLI:**\n\n```bash\nmaton connection list google-mail --status ACTIVE\n```\n\n```bash\nmaton api -X GET /connections -f app=google-mail -f status=ACTIVE\n```\n\n**Python:**\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://api.maton.ai/connections?app=google-mail&status=ACTIVE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Create Connection\n\n**CLI:**\n\n```bash\nmaton connection create google-mail\n```\n\n```bash\nmaton api /connections -f app=google-mail\n```\n\n**Python:**\n\n```bash\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'app': 'google-mail'}).encode()\nreq = urllib.request.Request('https://api.maton.ai/connections', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n```\n\n### Get Conn"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn75240wq8bnv2qm2xgry748jd80b9r0\",\n  \"slug\": \"gmail\",\n  \"version\": \"1.0.8\",\n  \"publishedAt\": 1778148211420\n}"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Gmail API integration with managed OAuth. Read, send, and manage emails, threads, labels, and drafts. Use this skill when users want to interact with Gmail.... Skill: Gmail Owner: byungkyu Summary: Gmail API integration with managed OAuth. Read, send, and manage emails, threads, labels, and drafts. Use this skill when users want to interact with Gmail.... Tags: latest:1.0.8 Version history: v1.0.8 | 2026-05-07T10:03:31.420Z | user - Added CLI usage examples throughout documentation for common Gmail operations. - Included installation instructions for Maton CLI via NPM and H","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":968,"uniquenessScore":49,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-05-14T06:29:33.558Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-05-14T06:29:33.558Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-09T14:22:49.951Z","emptyReason":null},"items":[{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-10T18:48:31.762Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}