strapi_create_tutorial
Create step-by-step tutorials in markdown format for Strapi CMS, specifying title, content, difficulty, duration, and metadata.
Instructions
Create a new tutorial with step-by-step content in markdown
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Tutorial title | |
| content | Yes | Tutorial content in MARKDOWN format | |
| description | No | Short description | |
| difficulty | No | Difficulty level | |
| duration | No | Estimated duration in minutes | |
| author_id | Yes | Author ID | |
| category_id | No | Category ID | |
| tag_ids | No | Array of tag IDs | |
| publishedAt | No | Publication date (ISO 8601) or null for draft |
Implementation Reference
- index.js:584-608 (handler)The core handler function that implements the strapi_create_tutorial tool. It constructs the tutorial data from arguments and makes a POST request to Strapi's tutorial collection endpoint to create the new tutorial.async createTutorial (headers, args) { const data = { title: args.title, content: args.content, description: args.description, difficulty: args.difficulty, duration: args.duration, author: args.author_id, category: args.category_id, tags: args.tag_ids, publishedAt: args.publishedAt || null } const response = await axios.post( `${this.strapiUrl}/content-manager/collection-types/api::tutorial.tutorial`, data, { headers } ) return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }] }
- index.js:206-219 (schema)The input schema defining the parameters, types, descriptions, and required fields for the strapi_create_tutorial tool.inputSchema: { type: 'object', properties: { title: { type: 'string', description: 'Tutorial title' }, content: { type: 'string', description: 'Tutorial content in MARKDOWN format' }, description: { type: 'string', description: 'Short description' }, difficulty: { type: 'string', enum: ['beginner', 'intermediate', 'advanced'], description: 'Difficulty level' }, duration: { type: 'number', description: 'Estimated duration in minutes' }, author_id: { type: 'number', description: 'Author ID' }, category_id: { type: 'number', description: 'Category ID' }, tag_ids: { type: 'array', items: { type: 'number' }, description: 'Array of tag IDs' }, publishedAt: { type: 'string', description: 'Publication date (ISO 8601) or null for draft' } }, required: ['title', 'content', 'author_id']
- index.js:203-221 (registration)The tool registration in the ListTools response, including name, description, and input schema.{ name: 'strapi_create_tutorial', description: 'Create a new tutorial with step-by-step content in markdown', inputSchema: { type: 'object', properties: { title: { type: 'string', description: 'Tutorial title' }, content: { type: 'string', description: 'Tutorial content in MARKDOWN format' }, description: { type: 'string', description: 'Short description' }, difficulty: { type: 'string', enum: ['beginner', 'intermediate', 'advanced'], description: 'Difficulty level' }, duration: { type: 'number', description: 'Estimated duration in minutes' }, author_id: { type: 'number', description: 'Author ID' }, category_id: { type: 'number', description: 'Category ID' }, tag_ids: { type: 'array', items: { type: 'number' }, description: 'Array of tag IDs' }, publishedAt: { type: 'string', description: 'Publication date (ISO 8601) or null for draft' } }, required: ['title', 'content', 'author_id'] } },
- index.js:390-391 (registration)The dispatch case in the CallToolRequest handler switch statement that routes to the createTutorial method.case 'strapi_create_tutorial': return await this.createTutorial(headers, request.params.arguments)