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
| Name | Required | Description | Default |
|---|---|---|---|
| document_id | Yes | Blog post document ID |
Implementation Reference
- index.js:483-496 (handler)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) }] } }
- index.js:142-148 (schema)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)