cancel
Cancel a pending Chrome Web Store submission currently in review. Use this to stop an extension upload or update before it is published.
Instructions
Cancel a pending submission on Chrome Web Store. Can be used to cancel an item currently in review.
Input 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') |
Implementation Reference
- src/index.ts:378-407 (registration)The 'cancel' tool is registered on the MCP server at lines 378-407. It accepts optional itemId and publisherId, resolves them, POSTs to the Chrome Web Store v2 API cancelSubmission endpoint, and formats the response.
server.tool( "cancel", "Cancel a pending submission on Chrome Web Store. Can be used to cancel an item currently in 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')"), }, async ({ itemId, publisherId }) => { try { const id = resolveItemId(itemId); const pub = resolvePublisherId(publisherId); const url = `${API_BASE}/v2/publishers/${pub}/items/${id}:cancelSubmission`; const result = await apiCall(url, { method: "POST" }); return formatResponse(result); } catch (e: any) { return { content: [{ type: "text" as const, text: `Error: ${e.message}` }], isError: true, }; } }, ); - src/index.ts:391-406 (handler)The handler function for the 'cancel' tool. It resolves item/publisher IDs, makes a POST request to the Chrome Web Store cancelSubmission API, and returns the result or an error.
async ({ itemId, publisherId }) => { try { const id = resolveItemId(itemId); const pub = resolvePublisherId(publisherId); const url = `${API_BASE}/v2/publishers/${pub}/items/${id}:cancelSubmission`; const result = await apiCall(url, { method: "POST" }); return formatResponse(result); } catch (e: any) { return { content: [{ type: "text" as const, text: `Error: ${e.message}` }], isError: true, }; } }, - src/index.ts:381-390 (schema)Zod schema for the 'cancel' tool: optional itemId and publisherId strings.
{ 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:78-86 (helper)Helper that resolves an optional itemId to a default from env var CWS_ITEM_ID, or throws.
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 that resolves an optional publisherId to a default from env var CWS_PUBLISHER_ID or 'me'.
function resolvePublisherId(publisherId?: string): string { return publisherId || PUBLISHER_ID; }