Skip to main content
Glama

iterate_loop

Execute one iteration of a loop with rhythm to advance creative workflows and strategic flows in the LLV Helix Framework.

Instructions

Execute one iteration of a loop with rhythm

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
loop_nameYesName of the loop to iterate
inputYesInput for this iteration
apply_rhythmNoApply the loop's rhythm pattern

Implementation Reference

  • The main handler function for the 'iterate_loop' tool. It retrieves the specified loop, performs an iteration with optional rhythm application, updates the loop state, and returns a visualization of the iteration.
    iterateLoop(args) { const { loop_name, input, apply_rhythm = true } = args; const loop = this.loops.get(loop_name); if (!loop) { return { content: [ { type: 'text', text: `❌ Loop "${loop_name}" not found.`, }, ], }; } const rhythm = apply_rhythm ? this.rhythms.get(`loop_${loop_name}`) : null; const iteration = { number: loop.iterations.length + 1, input, timestamp: new Date().toISOString(), rhythmStep: rhythm ? rhythm.next() : 1, phase: this.calculatePhase(loop.type, loop.iterations.length), }; loop.iterations.push(iteration); loop.phase = iteration.phase; return { content: [ { type: 'text', text: `πŸ”„ Loop "${loop_name}" - Iteration ${iteration.number}\n\nInput: "${input}"\nPhase: ${iteration.phase}Β°\nRhythm: ${iteration.rhythmStep}\n\n${this.visualizeLoopIteration(loop.type, iteration.number)}\n\nPattern: ${this.describeLoopBehavior(loop.type, iteration.number)}`, }, ], }; }
  • The input schema definition for the 'iterate_loop' tool, specifying parameters like loop_name, input, and apply_rhythm.
    { name: 'iterate_loop', description: 'Execute one iteration of a loop with rhythm', inputSchema: { type: 'object', properties: { loop_name: { type: 'string', description: 'Name of the loop to iterate', }, input: { type: 'string', description: 'Input for this iteration', }, apply_rhythm: { type: 'boolean', description: 'Apply the loop\'s rhythm pattern', default: true, }, }, required: ['loop_name', 'input'], },
  • index.js:341-342 (registration)
    The switch case registration that dispatches calls to the 'iterate_loop' tool to its handler method.
    case 'iterate_loop': return this.iterateLoop(args);

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