Skip to main content
Glama

upload

Update an existing Chrome Web Store item draft by providing a ZIP file. This revises your extension or theme before publishing.

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
NameRequiredDescriptionDefault
zipPathYesAbsolute path to the ZIP file to upload
itemIdNoExtension item ID (defaults to CWS_ITEM_ID env var)
publisherIdNoPublisher ID (defaults to CWS_PUBLISHER_ID env var or 'me')

Implementation Reference

  • src/index.ts:240-276 (registration)
    Registers the 'upload' tool on the MCP server with schema (zipPath required, itemId optional, publisherId optional) and handler that reads the ZIP file and calls the 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,
          };
        }
      },
    );
  • Input schema for the upload tool: zipPath (required string), itemId (optional string), publisherId (optional string).
      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')"),
    },
  • Handler function for the 'upload' tool. Resolves itemId and publisherId, reads the ZIP file, sends a POST request to the Chrome Web Store upload API endpoint, and returns the formatted API response.
    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,
        };
      }
    },
  • Constant UPLOAD_BASE defining the base URL for the Chrome Web Store upload API (https://chromewebstore.googleapis.com/upload/v2).
    const UPLOAD_BASE = "https://chromewebstore.googleapis.com/upload/v2";
  • src/index.ts:873-877 (registration)
    Sandbox registration of the 'upload' tool (a stub with noop handler) for the Smithery sandbox export.
    sandbox.tool("upload", "Upload a ZIP file to update an existing Chrome Web Store item draft.", {
      zipPath: z.string().describe("Absolute path to the ZIP file to upload"),
      itemId: z.string().optional().describe("Extension item ID"),
      publisherId: z.string().optional().describe("Publisher ID"),
    }, noop);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description fully bears the burden of behavioral disclosure. It only states 'update an existing draft' but omits details such as authentication requirements, rate limits, effect on previous draft, or return value.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences: the action is front-loaded, and the note adds essential context without excess.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers purpose and a key limitation, but lacks details on expected behavior (e.g., output, size limits, overwrite semantics) given the absence of an output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% (all parameters described). The description adds no additional meaning beyond the schema, meeting the baseline of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Upload a ZIP file to update an existing Chrome Web Store item draft', using a specific verb and resource. It distinguishes from siblings like 'get' or 'publish' by specifying the action is for draft updates.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description includes a note explicitly stating that creating new items is not supported via API and directs to the Developer Dashboard, providing a clear when-not-to-use. However, it does not contrast with sibling tools like 'update-metadata'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mikusnuz/cws-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server