deploy-percentage
Adjust the publish deploy percentage for staged rollouts on Chrome Web Store, enabling incremental updates to live users. Requires 10,000+ active users.
Instructions
Set the published deploy percentage for staged rollout on Chrome Web Store. The new percentage must be higher than the current target. Only available for items with 10,000+ seven-day active users.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| percentage | Yes | Deploy percentage (0-100). Must be larger than the current target percentage. | |
| 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:428-448 (handler)The async handler function that executes the deploy-percentage tool. Resolves item/publisher IDs, makes a POST request to the Chrome Web Store API endpoint `:setPublishedDeployPercentage` with the desired percentage, and formats the response.
async ({ percentage, itemId, publisherId }) => { try { const id = resolveItemId(itemId); const pub = resolvePublisherId(publisherId); const url = `${API_BASE}/v2/publishers/${pub}/items/${id}:setPublishedDeployPercentage`; const result = await apiCall(url, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ deployPercentage: percentage }), }); return formatResponse(result); } catch (e: any) { return { content: [{ type: "text" as const, text: `Error: ${e.message}` }], isError: true, }; } }, ); - src/index.ts:413-427 (schema)Input schema for the deploy-percentage tool: validates `percentage` (0-100 number), optional `itemId` (string), and optional `publisherId` (string).
{ percentage: z .number() .min(0) .max(100) .describe("Deploy percentage (0-100). Must be larger than the current target percentage."), 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')"), }, - src/index.ts:410-448 (registration)Registration of the 'deploy-percentage' tool with the MCP server via `server.tool()`, including its description, input schema, and handler.
server.tool( "deploy-percentage", "Set the published deploy percentage for staged rollout on Chrome Web Store. The new percentage must be higher than the current target. Only available for items with 10,000+ seven-day active users.", { percentage: z .number() .min(0) .max(100) .describe("Deploy percentage (0-100). Must be larger than the current target percentage."), 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 ({ percentage, itemId, publisherId }) => { try { const id = resolveItemId(itemId); const pub = resolvePublisherId(publisherId); const url = `${API_BASE}/v2/publishers/${pub}/items/${id}:setPublishedDeployPercentage`; const result = await apiCall(url, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ deployPercentage: percentage }), }); return formatResponse(result); } catch (e: any) { return { content: [{ type: "text" as const, text: `Error: ${e.message}` }], isError: true, }; } }, ); - src/index.ts:78-86 (helper)Helper function `resolveItemId` used to resolve the item ID from the parameter or fall back to the CWS_ITEM_ID environment variable.
function resolveItemId(itemId?: string): string { const id = itemId || DEFAULT_ITEM_ID; if (!id) { throw new Error( "No item ID provided. Pass itemId parameter or set CWS_ITEM_ID env var.", ); } return id; } - src/index.ts:88-90 (helper)Helper function `resolvePublisherId` used to resolve the publisher ID from the parameter or fall back to the CWS_PUBLISHER_ID env var (or 'me').
function resolvePublisherId(publisherId?: string): string { return publisherId || PUBLISHER_ID; }