upload
Update Chrome Web Store extension drafts by uploading ZIP files. This tool processes existing item updates through automated file submission.
Instructions
Upload a ZIP file to update an existing Chrome Web Store item draft. Note: Creating new items via API is not supported in v2 — use the Developer Dashboard to create new items.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| zipPath | Yes | Absolute path to the ZIP file to upload | |
| itemId | No | Extension item ID (defaults to CWS_ITEM_ID env var) | |
| publisherId | No | Publisher ID (defaults to CWS_PUBLISHER_ID env var or 'me') |
Implementation Reference
- src/index.ts:237-273 (handler)The "upload" tool handler. It resolves the item/publisher IDs, reads the ZIP file, and performs a POST request to the Google Chrome Web Store upload API.
server.tool( "upload", "Upload a ZIP file to update an existing Chrome Web Store item draft. Note: Creating new items via API is not supported in v2 — use the Developer Dashboard to create new items.", { zipPath: z.string().describe("Absolute path to the ZIP file to upload"), itemId: z .string() .optional() .describe("Extension item ID (defaults to CWS_ITEM_ID env var)"), publisherId: z .string() .optional() .describe("Publisher ID (defaults to CWS_PUBLISHER_ID env var or 'me')"), }, async ({ zipPath, itemId, publisherId }) => { try { const id = resolveItemId(itemId); const pub = resolvePublisherId(publisherId); const zipData = readFileSync(zipPath); const url = `${UPLOAD_BASE}/publishers/${pub}/items/${id}:upload`; const result = await apiCall(url, { method: "POST", headers: { "Content-Type": "application/zip" }, body: zipData, }); return formatResponse(result); } catch (e: any) { return { content: [{ type: "text" as const, text: `Error: ${e.message}` }], isError: true, }; } }, );