Skip to main content
Glama

unpublish_entry

Remove a published entry from a specific environment and locale. Specify content type UID, entry UID, and environment to unpublish content efficiently.

Instructions

Unpublishes an entry from a specified environment and locale.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
content_type_uidYesContent type UID
entry_uidYesEntry UID to unpublish
environmentYesEnvironment to unpublish from
localeNoLocale code (defaults to en-us)en-us

Implementation Reference

  • The handler function that executes the unpublish_entry tool. It constructs a payload with the specified environment and locale, sends a POST request to the Contentstack API unpublish endpoint, and returns success or error messages.
    async ({ content_type_uid, entry_uid, environment, locale }) => {
      try {
        // Prepare unpublish payload
        const payload = {
          entry: {
            environments: [environment],
            locales: [locale],
          },
        }
    
        // Unpublish the entry
        const response = await axios.post(
          `${API_BASE_URL}/content_types/${content_type_uid}/entries/${entry_uid}/unpublish`,
          payload,
          { headers: getHeaders() },
        )
    
        return {
          content: [
            {
              type: 'text',
              text: `Entry "${entry_uid}" unpublished successfully from environment "${environment}" in locale "${locale}".`,
            },
          ],
        }
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: handleError(error as ApiError),
            },
          ],
          isError: true,
        }
      }
    },
  • The Zod schema defining the input parameters for the unpublish_entry tool: content_type_uid, entry_uid, environment, and locale.
    {
      content_type_uid: z.string().describe('Content type UID'),
      entry_uid: z.string().describe('Entry UID to unpublish'),
      environment: z.string().describe('Environment to unpublish from'),
      locale: z.string().default('en-us').describe('Locale code (defaults to en-us)'),
    },
  • src/index.ts:1133-1179 (registration)
    The registration of the unpublish_entry tool on the MCP server using server.tool(), specifying the name, description, input schema, and handler function.
    server.tool(
      'unpublish_entry',
      'Unpublishes an entry from a specified environment and locale.',
      {
        content_type_uid: z.string().describe('Content type UID'),
        entry_uid: z.string().describe('Entry UID to unpublish'),
        environment: z.string().describe('Environment to unpublish from'),
        locale: z.string().default('en-us').describe('Locale code (defaults to en-us)'),
      },
      async ({ content_type_uid, entry_uid, environment, locale }) => {
        try {
          // Prepare unpublish payload
          const payload = {
            entry: {
              environments: [environment],
              locales: [locale],
            },
          }
    
          // Unpublish the entry
          const response = await axios.post(
            `${API_BASE_URL}/content_types/${content_type_uid}/entries/${entry_uid}/unpublish`,
            payload,
            { headers: getHeaders() },
          )
    
          return {
            content: [
              {
                type: 'text',
                text: `Entry "${entry_uid}" unpublished successfully from environment "${environment}" in locale "${locale}".`,
              },
            ],
          }
        } catch (error) {
          return {
            content: [
              {
                type: 'text',
                text: handleError(error as ApiError),
              },
            ],
            isError: true,
          }
        }
      },
    )
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('unpublishes') but doesn't clarify if this is reversible, requires specific permissions, affects related data, or has side effects like rate limits. This leaves significant gaps for a mutation tool.

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, efficient sentence that front-loads the core action and context. There is no wasted verbiage, making it easy to parse quickly.

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

Completeness2/5

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

For a mutation tool with no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits (e.g., reversibility, permissions), error handling, or return values, which are critical for safe and effective use.

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 description coverage is 100%, so the schema fully documents all parameters. The description adds no additional meaning beyond what the schema provides, such as explaining parameter interactions or constraints. Baseline 3 is appropriate as the schema handles the heavy lifting.

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

Purpose4/5

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

The description clearly states the action ('unpublishes') and resource ('an entry'), specifying the context ('from a specified environment and locale'). It distinguishes from siblings like 'publish_entry' by indicating the opposite operation, though it doesn't explicitly contrast with other deletion or update tools.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like 'delete_entry' or 'update_entry'. The description mentions the context (environment and locale) but doesn't specify prerequisites, exclusions, or scenarios for choosing this over other tools.

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

Related 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/darekrossman/contentstack-mcp'

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