{
  "schemaVersion": "1.0",
  "item": {
    "slug": "google-docs",
    "name": "Google Docs",
    "source": "tencent",
    "type": "skill",
    "category": "效率提升",
    "sourceUrl": "https://clawhub.ai/byungkyu/google-docs",
    "canonicalUrl": "https://clawhub.ai/byungkyu/google-docs",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/google-docs",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=google-docs",
    "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": "google-docs",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T01:52:12.569Z",
      "expiresAt": "2026-05-07T01:52:12.569Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=google-docs",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=google-docs",
        "contentDisposition": "attachment; filename=\"google-docs-1.0.5.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "google-docs"
      },
      "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/google-docs"
    },
    "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/google-docs",
    "agentPageUrl": "https://openagent3.xyz/skills/google-docs/agent",
    "manifestUrl": "https://openagent3.xyz/skills/google-docs/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/google-docs/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": "Google Docs",
        "body": "Access the Google Docs API with managed OAuth authentication. Create documents, insert and format text, and manage document content."
      },
      {
        "title": "Quick Start",
        "body": "# Get document\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/google-docs/v1/documents/{documentId}')\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-docs/{native-api-path}\n\nReplace {native-api-path} with the actual Google Docs API endpoint path. The gateway proxies requests to docs.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-docs&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-docs'}).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-docs\",\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 Google Docs 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-docs/v1/documents/{documentId}')\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": "Get Document",
        "body": "GET /google-docs/v1/documents/{documentId}"
      },
      {
        "title": "Create Document",
        "body": "POST /google-docs/v1/documents\nContent-Type: application/json\n\n{\n  \"title\": \"New Document\"\n}"
      },
      {
        "title": "Batch Update Document",
        "body": "POST /google-docs/v1/documents/{documentId}:batchUpdate\nContent-Type: application/json\n\n{\n  \"requests\": [\n    {\n      \"insertText\": {\n        \"location\": {\"index\": 1},\n        \"text\": \"Hello, World!\"\n      }\n    }\n  ]\n}"
      },
      {
        "title": "Insert Text",
        "body": "{\n  \"insertText\": {\n    \"location\": {\"index\": 1},\n    \"text\": \"Text to insert\"\n  }\n}"
      },
      {
        "title": "Delete Content",
        "body": "{\n  \"deleteContentRange\": {\n    \"range\": {\n      \"startIndex\": 1,\n      \"endIndex\": 10\n    }\n  }\n}"
      },
      {
        "title": "Replace All Text",
        "body": "{\n  \"replaceAllText\": {\n    \"containsText\": {\n      \"text\": \"{{placeholder}}\",\n      \"matchCase\": true\n    },\n    \"replaceText\": \"replacement value\"\n  }\n}"
      },
      {
        "title": "Insert Table",
        "body": "{\n  \"insertTable\": {\n    \"location\": {\"index\": 1},\n    \"rows\": 3,\n    \"columns\": 3\n  }\n}"
      },
      {
        "title": "Update Text Style",
        "body": "{\n  \"updateTextStyle\": {\n    \"range\": {\n      \"startIndex\": 1,\n      \"endIndex\": 10\n    },\n    \"textStyle\": {\n      \"bold\": true,\n      \"fontSize\": {\"magnitude\": 14, \"unit\": \"PT\"}\n    },\n    \"fields\": \"bold,fontSize\"\n  }\n}"
      },
      {
        "title": "Insert Page Break",
        "body": "{\n  \"insertPageBreak\": {\n    \"location\": {\"index\": 1}\n  }\n}"
      },
      {
        "title": "JavaScript",
        "body": "// Create document\nconst response = await fetch(\n  'https://gateway.maton.ai/google-docs/v1/documents',\n  {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n    },\n    body: JSON.stringify({ title: 'New Document' })\n  }\n);\n\n// Insert text\nawait fetch(\n  `https://gateway.maton.ai/google-docs/v1/documents/${docId}:batchUpdate`,\n  {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n    },\n    body: JSON.stringify({\n      requests: [{ insertText: { location: { index: 1 }, text: 'Hello!' } }]\n    })\n  }\n);"
      },
      {
        "title": "Python",
        "body": "import os\nimport requests\n\n# Create document\nresponse = requests.post(\n    'https://gateway.maton.ai/google-docs/v1/documents',\n    headers={'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'},\n    json={'title': 'New Document'}\n)"
      },
      {
        "title": "Notes",
        "body": "Index positions are 1-based (document starts at index 1)\nUse endOfSegmentLocation to append at end\nMultiple requests in batchUpdate are applied atomically\nGet document first to find correct indices for updates\nThe fields parameter in style updates uses field mask syntax\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 Google Docs connection401Invalid or missing Maton API key429Rate limited (10 req/sec per account)4xx/5xxPassthrough error from Google Docs 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-docs. For example:\n\nCorrect: https://gateway.maton.ai/google-docs/v1/documents/{documentId}\nIncorrect: https://gateway.maton.ai/docs/v1/documents/{documentId}"
      },
      {
        "title": "Resources",
        "body": "Docs API Overview\nGet Document\nCreate Document\nBatch Update\nRequest Types\nDocument Structure\nMaton Community\nMaton Support"
      }
    ],
    "body": "Google Docs\n\nAccess the Google Docs API with managed OAuth authentication. Create documents, insert and format text, and manage document content.\n\nQuick Start\n# Get document\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/google-docs/v1/documents/{documentId}')\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-docs/{native-api-path}\n\n\nReplace {native-api-path} with the actual Google Docs API endpoint path. The gateway proxies requests to docs.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-docs&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-docs'}).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-docs\",\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 Google Docs 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-docs/v1/documents/{documentId}')\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\nGet Document\nGET /google-docs/v1/documents/{documentId}\n\nCreate Document\nPOST /google-docs/v1/documents\nContent-Type: application/json\n\n{\n  \"title\": \"New Document\"\n}\n\nBatch Update Document\nPOST /google-docs/v1/documents/{documentId}:batchUpdate\nContent-Type: application/json\n\n{\n  \"requests\": [\n    {\n      \"insertText\": {\n        \"location\": {\"index\": 1},\n        \"text\": \"Hello, World!\"\n      }\n    }\n  ]\n}\n\nCommon batchUpdate Requests\nInsert Text\n{\n  \"insertText\": {\n    \"location\": {\"index\": 1},\n    \"text\": \"Text to insert\"\n  }\n}\n\nDelete Content\n{\n  \"deleteContentRange\": {\n    \"range\": {\n      \"startIndex\": 1,\n      \"endIndex\": 10\n    }\n  }\n}\n\nReplace All Text\n{\n  \"replaceAllText\": {\n    \"containsText\": {\n      \"text\": \"{{placeholder}}\",\n      \"matchCase\": true\n    },\n    \"replaceText\": \"replacement value\"\n  }\n}\n\nInsert Table\n{\n  \"insertTable\": {\n    \"location\": {\"index\": 1},\n    \"rows\": 3,\n    \"columns\": 3\n  }\n}\n\nUpdate Text Style\n{\n  \"updateTextStyle\": {\n    \"range\": {\n      \"startIndex\": 1,\n      \"endIndex\": 10\n    },\n    \"textStyle\": {\n      \"bold\": true,\n      \"fontSize\": {\"magnitude\": 14, \"unit\": \"PT\"}\n    },\n    \"fields\": \"bold,fontSize\"\n  }\n}\n\nInsert Page Break\n{\n  \"insertPageBreak\": {\n    \"location\": {\"index\": 1}\n  }\n}\n\nCode Examples\nJavaScript\n// Create document\nconst response = await fetch(\n  'https://gateway.maton.ai/google-docs/v1/documents',\n  {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n    },\n    body: JSON.stringify({ title: 'New Document' })\n  }\n);\n\n// Insert text\nawait fetch(\n  `https://gateway.maton.ai/google-docs/v1/documents/${docId}:batchUpdate`,\n  {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n    },\n    body: JSON.stringify({\n      requests: [{ insertText: { location: { index: 1 }, text: 'Hello!' } }]\n    })\n  }\n);\n\nPython\nimport os\nimport requests\n\n# Create document\nresponse = requests.post(\n    'https://gateway.maton.ai/google-docs/v1/documents',\n    headers={'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'},\n    json={'title': 'New Document'}\n)\n\nNotes\nIndex positions are 1-based (document starts at index 1)\nUse endOfSegmentLocation to append at end\nMultiple requests in batchUpdate are applied atomically\nGet document first to find correct indices for updates\nThe fields parameter in style updates uses field mask syntax\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 Google Docs connection\n401\tInvalid or missing Maton API key\n429\tRate limited (10 req/sec per account)\n4xx/5xx\tPassthrough error from Google Docs 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-docs. For example:\nCorrect: https://gateway.maton.ai/google-docs/v1/documents/{documentId}\nIncorrect: https://gateway.maton.ai/docs/v1/documents/{documentId}\nResources\nDocs API Overview\nGet Document\nCreate Document\nBatch Update\nRequest Types\nDocument Structure\nMaton Community\nMaton Support"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/byungkyu/google-docs",
    "publisherUrl": "https://clawhub.ai/byungkyu/google-docs",
    "owner": "byungkyu",
    "version": "1.0.5",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/google-docs",
    "downloadUrl": "https://openagent3.xyz/downloads/google-docs",
    "agentUrl": "https://openagent3.xyz/skills/google-docs/agent",
    "manifestUrl": "https://openagent3.xyz/skills/google-docs/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/google-docs/agent.md"
  }
}