create_loop
Build iterative cycles for strategic design and creative workflows by configuring loop patterns and rhythms to manage innovation processes.
Instructions
Create a loop - an iterative cycle
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name of the loop | |
| rhythm | No | Rhythm pattern of iterations | |
| type | Yes | Type of loop pattern |
Implementation Reference
- index.js:430-486 (handler)Main execution logic for create_loop tool: validates name and type, creates and stores loop object in this.loops, generates rhythm, returns success message with visualization.createLoop(args) { const { name, type, rhythm = 'constant' } = args; if (!name || name.trim().length === 0) { return { content: [ { type: 'text', text: `❌ Loop name is required. Please provide a name for the loop.`, }, ], }; } if (!type || type.trim().length === 0) { return { content: [ { type: 'text', text: `❌ Loop type is required. Please specify a type: infinite, convergent, divergent, spiral, or oscillating.`, }, ], }; } if (this.loops.has(name)) { return { content: [ { type: 'text', text: `⚠️ Loop "${name}" already exists. Use a different name or iterate the existing loop.`, }, ], }; } const loop = { name, type, rhythm, iterations: [], created_at: new Date().toISOString(), phase: 0, }; this.loops.set(name, loop); this.rhythms.set(`loop_${name}`, this.generateRhythm(rhythm)); return { content: [ { type: 'text', text: `🔄 Loop "${name}" created!\n\nType: ${type}\nRhythm: ${rhythm}\n\n${this.visualizeLoopPattern(type)}\n\nThe ${type} loop is ready with ${rhythm} rhythm.`, }, ], }; }
- index.js:75-94 (schema)JSON schema defining input parameters for create_loop: name (string, required), type (enum, required), rhythm (enum, optional).inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Name of the loop', }, type: { type: 'string', enum: ['infinite', 'convergent', 'divergent', 'spiral', 'oscillating'], description: 'Type of loop pattern', }, rhythm: { type: 'string', enum: ['constant', 'variable', 'fibonacci', 'exponential', 'harmonic'], description: 'Rhythm pattern of iterations', }, }, required: ['name', 'type'], },
- index.js:72-95 (registration)Tool descriptor registration in ListToolsRequestSchema response, including name, description, and inputSchema.{ name: 'create_loop', description: 'Create a loop - an iterative cycle', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Name of the loop', }, type: { type: 'string', enum: ['infinite', 'convergent', 'divergent', 'spiral', 'oscillating'], description: 'Type of loop pattern', }, rhythm: { type: 'string', enum: ['constant', 'variable', 'fibonacci', 'exponential', 'harmonic'], description: 'Rhythm pattern of iterations', }, }, required: ['name', 'type'], }, },
- index.js:333-334 (registration)Dispatch registration in CallToolRequestSchema switch statement: maps 'create_loop' to this.createLoop(args).case 'create_loop': return this.createLoop(args);
- index.js:920-929 (helper)Helper function used by createLoop to generate visual pattern for the loop type in the response.visualizeLoopPattern(type) { const patterns = { infinite: '∞∞∞∞∞', convergent: '◯◯◯•', divergent: '•◯◯◯', spiral: '🌀', oscillating: '↺↻↺↻', }; return patterns[type] || '◯◯◯◯'; }