Skip to main content
Glama

publish

Publish an extension to Chrome Web Store with options for immediate or staged rollout, deploy percentage, and skip-review.

Instructions

Publish an extension to Chrome Web Store. Supports immediate publish, staged publish, initial deploy percentage, and skip-review.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemIdNoExtension item ID (defaults to CWS_ITEM_ID env var)
publisherIdNoPublisher ID (defaults to CWS_PUBLISHER_ID env var or 'me')
publishTypeNoDEFAULT_PUBLISH: publishes immediately after approval. STAGED_PUBLISH: stages for manual publishing after approval. Defaults to DEFAULT_PUBLISH.
deployPercentageNoInitial deploy percentage for staged rollout (0-100). Only used with STAGED_PUBLISH or DEFAULT_PUBLISH.
skipReviewNoAttempt to skip review if the extension qualifies. Defaults to false.

Implementation Reference

  • Handler function for the 'publish' tool. Calls the Chrome Web Store v2 API to publish an extension, supporting immediate publish, staged publish, deploy percentage, and skip-review options.
    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,
        };
      }
    },
  • Zod schema definitions for the 'publish' tool parameters: itemId, publisherId, publishType (DEFAULT_PUBLISH|STAGED_PUBLISH), deployPercentage (0-100), and skipReview (boolean).
    {
      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."),
    },
  • src/index.ts:278-343 (registration)
    Registration of the 'publish' tool via server.tool() with name 'publish', description, schema, and handler.
    // ── publish ──
    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,
          };
        }
      },
    );
  • resolvePublisherId helper used by the publish handler to resolve the publisher ID from argument or environment variable.
    function resolvePublisherId(publisherId?: string): string {
      return publisherId || PUBLISHER_ID;
    }
  • resolveItemId helper used by the publish handler to resolve the item ID from argument or 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;
    }
Behavior3/5

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

With no annotations provided, the description carries the burden of disclosing behavioral traits. It mentions support for immediate/staged publish, deploy percentage, and skip-review, which adds some transparency. However, it does not disclose potential irreversible effects (e.g., overriding a live version) or error scenarios.

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?

The description is a single succinct sentence that efficiently communicates the tool's purpose and key features. It is front-loaded and avoids unnecessary words.

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?

Given the absence of an output schema and annotations, the description could provide more context about prerequisites (e.g., item must be uploaded first), return values, or typical error conditions. It covers core features but lacks completeness for a complex publish workflow.

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?

The input schema has 100% coverage with detailed parameter descriptions. The description only summarizes the capabilities (immediate, staged, etc.) without adding new semantic depth beyond what the schema already provides. Baseline score of 3 is appropriate.

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 the verb 'Publish' and the resource 'extension to Chrome Web Store', making the action specific. It distinguishes well from sibling tools like 'upload' and 'cancel', as publishing is a distinct final step.

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

Usage Guidelines3/5

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

The description implies that publishing is performed after an upload, but does not explicitly state when to use this tool versus siblings (e.g., upload first). No alternatives or prerequisites are mentioned, leaving usage context somewhat vague.

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