publish
Publish Chrome Web Store extensions with options for immediate release, staged rollouts, or skipping review when eligible.
Instructions
Publish an extension to Chrome Web Store. Supports immediate publish, staged publish, initial deploy percentage, and skip-review.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| 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') | |
| publishType | No | DEFAULT_PUBLISH: publishes immediately after approval. STAGED_PUBLISH: stages for manual publishing after approval. Defaults to DEFAULT_PUBLISH. | |
| deployPercentage | No | Initial deploy percentage for staged rollout (0-100). Only used with STAGED_PUBLISH or DEFAULT_PUBLISH. | |
| skipReview | No | Attempt to skip review if the extension qualifies. Defaults to false. |
Implementation Reference
- src/index.ts:276-340 (handler)The 'publish' tool implementation handles Chrome Web Store extension publishing by calling the Google API. It parses parameters, prepares the JSON payload for publish settings, and executes the API call.
server.tool( "publish", "Publish an extension to Chrome Web Store. Supports immediate publish, staged publish, initial deploy percentage, and skip-review.", { 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')"), publishType: z .enum(["DEFAULT_PUBLISH", "STAGED_PUBLISH"]) .optional() .describe( "DEFAULT_PUBLISH: publishes immediately after approval. STAGED_PUBLISH: stages for manual publishing after approval. Defaults to DEFAULT_PUBLISH." ), deployPercentage: z .number() .int() .min(0) .max(100) .optional() .describe("Initial deploy percentage for staged rollout (0-100). Only used with STAGED_PUBLISH or DEFAULT_PUBLISH."), skipReview: z .boolean() .optional() .describe("Attempt to skip review if the extension qualifies. Defaults to false."), }, async ({ itemId, publisherId, publishType, deployPercentage, skipReview }) => { try { const id = resolveItemId(itemId); const pub = resolvePublisherId(publisherId); const url = `${API_BASE}/v2/publishers/${pub}/items/${id}:publish`; const body: Record<string, unknown> = {}; if (publishType) body.publishType = publishType; if (deployPercentage !== undefined) { body.deployInfos = [{ deployPercentage }]; } if (skipReview !== undefined) body.skipReview = skipReview; const hasBody = Object.keys(body).length > 0; const result = await apiCall(url, { method: "POST", ...(hasBody ? { headers: { "Content-Type": "application/json" }, body: JSON.stringify(body), } : {}), }); return formatResponse(result); } catch (e: any) { return { content: [{ type: "text" as const, text: `Error: ${e.message}` }], isError: true, }; } }, );