{
  "schemaVersion": "1.0",
  "item": {
    "slug": "gmail",
    "name": "Gmail",
    "source": "tencent",
    "type": "skill",
    "category": "效率提升",
    "sourceUrl": "https://clawhub.ai/byungkyu/gmail",
    "canonicalUrl": "https://clawhub.ai/byungkyu/gmail",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/gmail",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=gmail",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "LICENSE.txt"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "slug": "gmail",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T00:26:26.686Z",
      "expiresAt": "2026-05-07T00:26:26.686Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=gmail",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=gmail",
        "contentDisposition": "attachment; filename=\"gmail-1.0.6.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "gmail"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/gmail"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/gmail",
    "agentPageUrl": "https://openagent3.xyz/skills/gmail/agent",
    "manifestUrl": "https://openagent3.xyz/skills/gmail/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/gmail/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Gmail",
        "body": "Access the Gmail API with managed OAuth authentication. Read, send, and manage emails, threads, labels, and drafts."
      },
      {
        "title": "Quick Start",
        "body": "# 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"
      },
      {
        "title": "Base URL",
        "body": "https://gateway.maton.ai/google-mail/{native-api-path}\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."
      },
      {
        "title": "Authentication",
        "body": "All requests require the Maton API key in the Authorization header:\n\nAuthorization: Bearer $MATON_API_KEY\n\nEnvironment Variable: Set your API key as MATON_API_KEY:\n\nexport MATON_API_KEY=\"YOUR_API_KEY\""
      },
      {
        "title": "Getting Your API Key",
        "body": "Sign in or create an account at maton.ai\nGo to maton.ai/settings\nCopy your API key"
      },
      {
        "title": "Connection Management",
        "body": "Manage your Google OAuth connections at https://ctrl.maton.ai."
      },
      {
        "title": "List Connections",
        "body": "python <<'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"
      },
      {
        "title": "Create Connection",
        "body": "python <<'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"
      },
      {
        "title": "Get Connection",
        "body": "python <<'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\nResponse:\n\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\nOpen the returned url in a browser to complete OAuth authorization."
      },
      {
        "title": "Delete Connection",
        "body": "python <<'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"
      },
      {
        "title": "Specifying Connection",
        "body": "If you have multiple Gmail connections, specify which one to use with the Maton-Connection header:\n\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\nIf omitted, the gateway uses the default (oldest) active connection."
      },
      {
        "title": "List Messages",
        "body": "GET /google-mail/gmail/v1/users/me/messages?maxResults=10\n\nWith query filter:\n\nGET /google-mail/gmail/v1/users/me/messages?q=is:unread&maxResults=10"
      },
      {
        "title": "Get Message",
        "body": "GET /google-mail/gmail/v1/users/me/messages/{messageId}\n\nWith metadata only:\n\nGET /google-mail/gmail/v1/users/me/messages/{messageId}?format=metadata&metadataHeaders=From&metadataHeaders=Subject&metadataHeaders=Date"
      },
      {
        "title": "Send Message",
        "body": "POST /google-mail/gmail/v1/users/me/messages/send\nContent-Type: application/json\n\n{\n  \"raw\": \"BASE64_ENCODED_EMAIL\"\n}"
      },
      {
        "title": "List Labels",
        "body": "GET /google-mail/gmail/v1/users/me/labels"
      },
      {
        "title": "List Threads",
        "body": "GET /google-mail/gmail/v1/users/me/threads?maxResults=10"
      },
      {
        "title": "Get Thread",
        "body": "GET /google-mail/gmail/v1/users/me/threads/{threadId}"
      },
      {
        "title": "Modify Message Labels",
        "body": "POST /google-mail/gmail/v1/users/me/messages/{messageId}/modify\nContent-Type: application/json\n\n{\n  \"addLabelIds\": [\"STARRED\"],\n  \"removeLabelIds\": [\"UNREAD\"]\n}"
      },
      {
        "title": "Trash Message",
        "body": "POST /google-mail/gmail/v1/users/me/messages/{messageId}/trash"
      },
      {
        "title": "Create Draft",
        "body": "POST /google-mail/gmail/v1/users/me/drafts\nContent-Type: application/json\n\n{\n  \"message\": {\n    \"raw\": \"BASE64URL_ENCODED_EMAIL\"\n  }\n}"
      },
      {
        "title": "Send Draft",
        "body": "POST /google-mail/gmail/v1/users/me/drafts/send\nContent-Type: application/json\n\n{\n  \"id\": \"{draftId}\"\n}"
      },
      {
        "title": "Get Profile",
        "body": "GET /google-mail/gmail/v1/users/me/profile"
      },
      {
        "title": "Query Operators",
        "body": "Use in the q parameter:\n\nis:unread - Unread messages\nis:starred - Starred messages\nfrom:email@example.com - From specific sender\nto:email@example.com - To specific recipient\nsubject:keyword - Subject contains keyword\nafter:2024/01/01 - After date\nbefore:2024/12/31 - Before date\nhas:attachment - Has attachments"
      },
      {
        "title": "JavaScript",
        "body": "const 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);"
      },
      {
        "title": "Python",
        "body": "import 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)"
      },
      {
        "title": "Notes",
        "body": "Use me as userId for the authenticated user\nMessage body is base64url encoded in the raw field\nCommon labels: INBOX, SENT, DRAFT, STARRED, UNREAD, TRASH\nIMPORTANT: When using curl commands, use curl -g when URLs contain brackets (fields[], sort[], records[]) to disable glob parsing\nIMPORTANT: 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."
      },
      {
        "title": "Error Handling",
        "body": "StatusMeaning400Missing Gmail connection401Invalid or missing Maton API key429Rate limited (10 req/sec per account)4xx/5xxPassthrough error from Gmail API"
      },
      {
        "title": "Troubleshooting: API Key Issues",
        "body": "Check that the MATON_API_KEY environment variable is set:\n\necho $MATON_API_KEY\n\nVerify the API key is valid by listing connections:\n\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"
      },
      {
        "title": "Troubleshooting: Invalid App Name",
        "body": "Ensure your URL path starts with google-mail. For example:\n\nCorrect: https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages\nIncorrect: https://gateway.maton.ai/gmail/v1/users/me/messages"
      },
      {
        "title": "Resources",
        "body": "Gmail API Overview\nList Messages\nGet Message\nSend Message\nList Threads\nList Labels\nCreate Draft\nMaton Community\nMaton Support"
      }
    ],
    "body": "Gmail\n\nAccess the Gmail API with managed OAuth authentication. Read, send, and manage emails, threads, labels, and drafts.\n\nQuick Start\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\nBase URL\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\nAuthentication\n\nAll requests require the Maton API key in the Authorization header:\n\nAuthorization: Bearer $MATON_API_KEY\n\n\nEnvironment Variable: Set your API key as MATON_API_KEY:\n\nexport MATON_API_KEY=\"YOUR_API_KEY\"\n\nGetting Your API Key\nSign in or create an account at maton.ai\nGo to maton.ai/settings\nCopy your API key\nConnection Management\n\nManage your Google OAuth connections at https://ctrl.maton.ai.\n\nList Connections\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\nCreate Connection\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\nGet Connection\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\nResponse:\n\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\nDelete Connection\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\nSpecifying Connection\n\nIf you have multiple Gmail connections, specify which one to use with the Maton-Connection header:\n\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\nAPI Reference\nList Messages\nGET /google-mail/gmail/v1/users/me/messages?maxResults=10\n\n\nWith query filter:\n\nGET /google-mail/gmail/v1/users/me/messages?q=is:unread&maxResults=10\n\nGet Message\nGET /google-mail/gmail/v1/users/me/messages/{messageId}\n\n\nWith metadata only:\n\nGET /google-mail/gmail/v1/users/me/messages/{messageId}?format=metadata&metadataHeaders=From&metadataHeaders=Subject&metadataHeaders=Date\n\nSend Message\nPOST /google-mail/gmail/v1/users/me/messages/send\nContent-Type: application/json\n\n{\n  \"raw\": \"BASE64_ENCODED_EMAIL\"\n}\n\nList Labels\nGET /google-mail/gmail/v1/users/me/labels\n\nList Threads\nGET /google-mail/gmail/v1/users/me/threads?maxResults=10\n\nGet Thread\nGET /google-mail/gmail/v1/users/me/threads/{threadId}\n\nModify Message Labels\nPOST /google-mail/gmail/v1/users/me/messages/{messageId}/modify\nContent-Type: application/json\n\n{\n  \"addLabelIds\": [\"STARRED\"],\n  \"removeLabelIds\": [\"UNREAD\"]\n}\n\nTrash Message\nPOST /google-mail/gmail/v1/users/me/messages/{messageId}/trash\n\nCreate Draft\nPOST /google-mail/gmail/v1/users/me/drafts\nContent-Type: application/json\n\n{\n  \"message\": {\n    \"raw\": \"BASE64URL_ENCODED_EMAIL\"\n  }\n}\n\nSend Draft\nPOST /google-mail/gmail/v1/users/me/drafts/send\nContent-Type: application/json\n\n{\n  \"id\": \"{draftId}\"\n}\n\nGet Profile\nGET /google-mail/gmail/v1/users/me/profile\n\nQuery Operators\n\nUse in the q parameter:\n\nis:unread - Unread messages\nis:starred - Starred messages\nfrom:email@example.com - From specific sender\nto:email@example.com - To specific recipient\nsubject:keyword - Subject contains keyword\nafter:2024/01/01 - After date\nbefore:2024/12/31 - Before date\nhas:attachment - Has attachments\nCode Examples\nJavaScript\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\nPython\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\nNotes\nUse me as userId for the authenticated user\nMessage body is base64url encoded in the raw field\nCommon labels: INBOX, SENT, DRAFT, STARRED, UNREAD, TRASH\nIMPORTANT: When using curl commands, use curl -g when URLs contain brackets (fields[], sort[], records[]) to disable glob parsing\nIMPORTANT: 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.\nError Handling\nStatus\tMeaning\n400\tMissing Gmail connection\n401\tInvalid or missing Maton API key\n429\tRate limited (10 req/sec per account)\n4xx/5xx\tPassthrough error from Gmail API\nTroubleshooting: API Key Issues\nCheck that the MATON_API_KEY environment variable is set:\necho $MATON_API_KEY\n\nVerify the API key is valid by listing connections:\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\nTroubleshooting: Invalid App Name\nEnsure your URL path starts with google-mail. For example:\nCorrect: https://gateway.maton.ai/google-mail/gmail/v1/users/me/messages\nIncorrect: https://gateway.maton.ai/gmail/v1/users/me/messages\nResources\nGmail API Overview\nList Messages\nGet Message\nSend Message\nList Threads\nList Labels\nCreate Draft\nMaton Community\nMaton Support"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/byungkyu/gmail",
    "publisherUrl": "https://clawhub.ai/byungkyu/gmail",
    "owner": "byungkyu",
    "version": "1.0.6",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/gmail",
    "downloadUrl": "https://openagent3.xyz/downloads/gmail",
    "agentUrl": "https://openagent3.xyz/skills/gmail/agent",
    "manifestUrl": "https://openagent3.xyz/skills/gmail/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/gmail/agent.md"
  }
}