Skip to main content
Glama

strapi_list_blog_posts

Retrieve blog posts from Strapi CMS with filtering by status, category, author, or tags, plus sorting and pagination options.

Instructions

List all blog posts with advanced filtering, sorting, and pagination

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number
pageSizeNoResults per page
statusNoFilter by statusall
category_idNoFilter by category ID
author_idNoFilter by author ID
tag_idNoFilter by tag ID
sortNoSort field and direction (e.g., "publishedAt:desc", "title:asc")createdAt:desc
searchNoSearch in title and content

Implementation Reference

  • The main handler function that lists blog posts by making a GET request to Strapi's content-manager API with pagination parameters.
    async listBlogPosts (headers, args = {}) { const { page = 1, pageSize = 25, status = 'all' } = args const response = await axios.get( `${this.strapiUrl}/content-manager/collection-types/api::blog-post.blog-post`, { headers, params: { page, pageSize } } ) return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }] } }
  • Input schema defining the parameters for listing blog posts, including pagination, filtering, sorting, and search options.
    inputSchema: { type: 'object', properties: { page: { type: 'number', description: 'Page number', default: 1 }, pageSize: { type: 'number', description: 'Results per page', default: 25 }, status: { type: 'string', enum: ['published', 'draft', 'all'], description: 'Filter by status', default: 'all' }, category_id: { type: 'number', description: 'Filter by category ID' }, author_id: { type: 'number', description: 'Filter by author ID' }, tag_id: { type: 'number', description: 'Filter by tag ID' }, sort: { type: 'string', description: 'Sort field and direction (e.g., "publishedAt:desc", "title:asc")', default: 'createdAt:desc' }, search: { type: 'string', description: 'Search in title and content' } } }
  • index.js:122-138 (registration)
    Registration of the tool in the ListToolsRequestSchema handler, providing name, description, and input schema.
    { name: 'strapi_list_blog_posts', description: 'List all blog posts with advanced filtering, sorting, and pagination', inputSchema: { type: 'object', properties: { page: { type: 'number', description: 'Page number', default: 1 }, pageSize: { type: 'number', description: 'Results per page', default: 25 }, status: { type: 'string', enum: ['published', 'draft', 'all'], description: 'Filter by status', default: 'all' }, category_id: { type: 'number', description: 'Filter by category ID' }, author_id: { type: 'number', description: 'Filter by author ID' }, tag_id: { type: 'number', description: 'Filter by tag ID' }, sort: { type: 'string', description: 'Sort field and direction (e.g., "publishedAt:desc", "title:asc")', default: 'createdAt:desc' }, search: { type: 'string', description: 'Search in title and content' } } } },
  • index.js:368-369 (registration)
    Switch case in CallToolRequestSchema handler that dispatches execution to the listBlogPosts method.
    case 'strapi_list_blog_posts': return await this.listBlogPosts(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