create_line
Establish connections between points by defining a path with customizable rhythm, enabling structured flow creation in strategic and creative workflows.
Instructions
Create a line - a connection or path between points
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | Yes | Starting point | |
| name | Yes | Name of the line | |
| rhythm | No | Rhythm of the line | |
| to | Yes | Ending point |
Implementation Reference
- index.js:361-428 (handler)The createLine method implements the core logic of the 'create_line' tool. It validates required parameters (name, from, to), checks for duplicates, creates and stores a line object in the server's state (this.lines Map), generates a rhythm generator, and returns a success message with visualization.createLine(args) { const { name, from, to, rhythm = 'steady' } = args; if (!name || name.trim().length === 0) { return { content: [ { type: 'text', text: `❌ Line name is required. Please provide a name for the line.`, }, ], }; } if (!from || from.trim().length === 0) { return { content: [ { type: 'text', text: `❌ Starting point (from) is required. Please specify where the line starts.`, }, ], }; } if (!to || to.trim().length === 0) { return { content: [ { type: 'text', text: `❌ Ending point (to) is required. Please specify where the line ends.`, }, ], }; } if (this.lines.has(name)) { return { content: [ { type: 'text', text: `⚠️ Line "${name}" already exists. Use a different name or trace the existing line.`, }, ], }; } const line = { name, from, to, rhythm, created_at: new Date().toISOString(), traces: [], }; this.lines.set(name, line); this.rhythms.set(`line_${name}`, this.generateRhythm(rhythm)); return { content: [ { type: 'text', text: `〰️ Line "${name}" created!\n\nFrom: ${from} → To: ${to}\nRhythm: ${rhythm}\n\n${this.visualizeLineRhythm(rhythm)}\n\nThe line is ready to carry messages with ${rhythm} rhythm.`, }, ], }; }
- index.js:48-70 (schema)Input schema definition for the 'create_line' tool, specifying properties (name, from, to, rhythm), types, descriptions, enum for rhythm, and required fields.inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Name of the line', }, from: { type: 'string', description: 'Starting point', }, to: { type: 'string', description: 'Ending point', }, rhythm: { type: 'string', enum: ['steady', 'accelerating', 'pulsing', 'syncopated', 'flowing'], description: 'Rhythm of the line', }, }, required: ['name', 'from', 'to'], },
- index.js:45-71 (registration)Tool registration in the ListTools response: defines name, description, and inputSchema for 'create_line'.{ name: 'create_line', description: 'Create a line - a connection or path between points', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Name of the line', }, from: { type: 'string', description: 'Starting point', }, to: { type: 'string', description: 'Ending point', }, rhythm: { type: 'string', enum: ['steady', 'accelerating', 'pulsing', 'syncopated', 'flowing'], description: 'Rhythm of the line', }, }, required: ['name', 'from', 'to'], }, },
- index.js:331-332 (registration)Dispatch case in CallToolRequest handler that routes 'create_line' calls to the createLine method.case 'create_line': return this.createLine(args);