Skip to main content
Glama

strapi_get_blog_post

Retrieve a specific blog post from Strapi CMS using its document ID to access content details and metadata.

Instructions

Get a specific blog post by document ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
document_idYesBlog post document ID

Implementation Reference

  • The handler function that retrieves a specific blog post by its document ID using a GET request to Strapi's content-manager API endpoint. It returns the response data as JSON text.
    async getBlogPost (headers, args) {
      // Strapi 5 uses documentId for single document operations
      const response = await axios.get(
        `${this.strapiUrl}/content-manager/collection-types/api::blog-post.blog-post/${args.document_id}`,
        { headers }
      )
    
      return {
        content: [{
          type: 'text',
          text: JSON.stringify(response.data, null, 2)
        }]
      }
    }
  • Input schema definition for the tool, requiring a 'document_id' string parameter.
    inputSchema: {
      type: 'object',
      properties: {
        document_id: { type: 'string', description: 'Blog post document ID' }
      },
      required: ['document_id']
    }
  • index.js:139-150 (registration)
    Registration of the tool in the ListToolsRequestHandler, including name, description, and input schema.
    {
      name: 'strapi_get_blog_post',
      description: 'Get a specific blog post by document ID',
      inputSchema: {
        type: 'object',
        properties: {
          document_id: { type: 'string', description: 'Blog post document ID' }
        },
        required: ['document_id']
      }
    },
    {
  • index.js:371-372 (registration)
    Handler dispatch in the CallToolRequestHandler switch statement, routing calls to the getBlogPost method.
    case 'strapi_get_blog_post':
      return await this.getBlogPost(headers, request.params.arguments)

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