set_context
Configure creative contexts to influence rhythms in the LLV Helix Framework, specifying context type and what it affects for strategic workflows.
Instructions
Set the context that influences rhythms
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Context name | |
| type | Yes | Type of context | |
| influences | No | What this context influences (lines/loops/vibes names) |
Implementation Reference
- index.js:546-573 (handler)The handler function for the 'set_context' tool. It creates and stores a context object, applies rhythm modifiers to specified influences, and returns a formatted response.setContext(args) { const { name, type, influences = [] } = args; const context = { name, type, influences, created_at: new Date().toISOString(), }; this.contexts.set(name, context); const rhythmModifier = this.getContextRhythmModifier(type); influences.forEach(element => { if (this.rhythms.has(`line_${element}`) || this.rhythms.has(`loop_${element}`) || this.rhythms.has(`vibe_${element}`)) { this.applyContextToRhythm(element, rhythmModifier); } }); return { content: [ { type: 'text', text: `π Context "${name}" set!\n\nType: ${type}\nInfluences: ${influences.join(', ') || 'None'}\n\n${this.visualizeContext(type)}\n\nThe ${type} context will modify rhythms of influenced elements.`, }, ], }; }
- index.js:126-149 (schema)The input schema and metadata for the 'set_context' tool, defined in the ListToolsRequest handler.{ name: 'set_context', description: 'Set the context that influences rhythms', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Context name', }, type: { type: 'string', enum: ['creative', 'analytical', 'meditative', 'collaborative', 'experimental'], description: 'Type of context', }, influences: { type: 'array', items: { type: 'string' }, description: 'What this context influences (lines/loops/vibes names)', }, }, required: ['name', 'type'], }, },
- index.js:337-338 (registration)Registration/dispatch case in the CallToolRequest handler that invokes the setContext handler.case 'set_context': return this.setContext(args);
- index.js:894-903 (helper)Helper function used by setContext to get the rhythm multiplier based on context type.getContextRhythmModifier(contextType) { const modifiers = { creative: 1.5, analytical: 0.8, meditative: 0.5, collaborative: 1.2, experimental: 2.0, }; return modifiers[contextType] || 1.0; }
- index.js:943-952 (helper)Helper function used by setContext to generate a visual representation of the context type.visualizeContext(type) { const contexts = { creative: 'π¨ π πͺ π¨', analytical: 'π π π π', meditative: 'β―οΈ β―οΈ β―οΈ β―οΈ', collaborative: 'π€ π€ π€ π€', experimental: 'π§ͺ π¬ βοΈ π§¬', }; return contexts[type] || 'ββββ'; }