Skip to main content
Glama

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
NameRequiredDescriptionDefault
nameYesName of the loop
rhythmNoRhythm pattern of iterations
typeYesType of loop pattern

Implementation Reference

  • 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.`, }, ], }; }
  • 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);
  • 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] || '◯◯◯◯'; }

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/suhitanantula/llv-helix'

If you have feedback or need assistance with the MCP directory API, please join our Discord server