strapi_update_tutorial
Modify existing tutorial content in Strapi CMS by updating title, description, difficulty level, duration, or markdown content using document ID.
Instructions
Update an existing tutorial
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| document_id | Yes | Tutorial document ID | |
| title | No | New title | |
| content | No | New content in MARKDOWN | |
| description | No | New description | |
| difficulty | No | New difficulty | |
| duration | No | New duration in minutes |
Implementation Reference
- index.js:647-666 (handler)The core handler function that executes the tool logic by constructing update data from arguments and sending a PUT request to Strapi's tutorial endpoint.async updateTutorial (headers, args) { const data = {} if (args.title) data.title = args.title if (args.content) data.content = args.content if (args.description) data.description = args.description if (args.difficulty) data.difficulty = args.difficulty if (args.duration) data.duration = args.duration const response = await axios.put( `${this.strapiUrl}/content-manager/collection-types/api::tutorial.tutorial/${args.document_id}`, data, { headers } ) return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }] }
- index.js:251-261 (schema)Input schema defining the parameters for the strapi_update_tutorial tool, including required document_id and optional fields for update.inputSchema: { type: 'object', properties: { document_id: { type: 'string', description: 'Tutorial document ID' }, title: { type: 'string', description: 'New title' }, content: { type: 'string', description: 'New content in MARKDOWN' }, description: { type: 'string', description: 'New description' }, difficulty: { type: 'string', enum: ['beginner', 'intermediate', 'advanced'], description: 'New difficulty' }, duration: { type: 'number', description: 'New duration in minutes' } }, required: ['document_id']
- index.js:248-262 (registration)Tool registration in the ListTools response, defining name, description, and input schema for strapi_update_tutorial.{ name: 'strapi_update_tutorial', description: 'Update an existing tutorial', inputSchema: { type: 'object', properties: { document_id: { type: 'string', description: 'Tutorial document ID' }, title: { type: 'string', description: 'New title' }, content: { type: 'string', description: 'New content in MARKDOWN' }, description: { type: 'string', description: 'New description' }, difficulty: { type: 'string', enum: ['beginner', 'intermediate', 'advanced'], description: 'New difficulty' }, duration: { type: 'number', description: 'New duration in minutes' } }, required: ['document_id'] }
- index.js:399-400 (registration)Handler dispatch registration in the CallToolRequest switch statement, mapping the tool name to the updateTutorial method.case 'strapi_update_tutorial': return await this.updateTutorial(headers, request.params.arguments)