Skip to main content
Glama

strapi_publish_event

Publish or unpublish events in Strapi CMS by specifying the document ID and publication status.

Instructions

Publish or unpublish an event

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
document_idYesEvent document ID
publishNotrue to publish, false to unpublish

Implementation Reference

  • The main handler function for strapi_publish_event. Updates the event's publishedAt field via Strapi Content Manager API to publish (set to current timestamp) or unpublish (set to null).
    async publishEvent (headers, args) {
      const data = {
        publishedAt: args.publish ? new Date().toISOString() : null
      }
    
      const response = await axios.put(
        `${this.strapiUrl}/content-manager/collection-types/api::event.event/${args.document_id}`,
        data,
        { headers }
      )
    
      return {
        content: [{
          type: 'text',
          text: JSON.stringify(response.data, null, 2)
        }]
      }
    }
  • Input schema definition for the strapi_publish_event tool, specifying parameters for document_id and optional publish boolean.
    inputSchema: {
      type: 'object',
      properties: {
        document_id: { type: 'string', description: 'Event document ID' },
        publish: { type: 'boolean', description: 'true to publish, false to unpublish', default: true }
      },
      required: ['document_id']
    }
  • index.js:339-350 (registration)
    Tool registration in ListTools response, including name, description, and full input schema.
    {
      name: 'strapi_publish_event',
      description: 'Publish or unpublish an event',
      inputSchema: {
        type: 'object',
        properties: {
          document_id: { type: 'string', description: 'Event document ID' },
          publish: { type: 'boolean', description: 'true to publish, false to unpublish', default: true }
        },
        required: ['document_id']
      }
    }
  • index.js:418-419 (registration)
    Handler dispatch registration in the CallToolRequest switch statement, routing to publishEvent method.
    case 'strapi_publish_event':
      return await this.publishEvent(headers, request.params.arguments)
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It indicates a mutation operation ('Publish or unpublish') but doesn't address permission requirements, whether the action is reversible, potential side effects, or what happens to the event's visibility. For a mutation tool with zero annotation coverage, this leaves significant behavioral questions unanswered.

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 extremely concise at just four words, with zero wasted language. It's front-loaded with the core action and resource, making it immediately understandable without any unnecessary elaboration.

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 insufficiently complete. It doesn't explain what 'publishing' means in this context, what the expected outcome is, whether there are validation requirements, or what happens if the operation fails. Given the complexity of a state-change operation, more context is needed.

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% description coverage, with both parameters clearly documented in the schema itself. The description doesn't add any meaningful parameter information beyond what's already in the schema, so it meets the baseline of 3 where the schema does 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 ('Publish or unpublish') and resource ('an event'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'strapi_publish_blog_post' and 'strapi_publish_tutorial' which perform similar operations on different content types.

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?

The description provides no guidance on when to use this tool versus alternatives like 'strapi_update_event' for other modifications, nor does it mention prerequisites such as needing an existing event document. It simply states what the tool does without context about appropriate use cases.

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/AINative-Studio/ainative-strapi-mcp-server'

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