Skip to main content
Glama
Mming-Lab
by Mming-Lab

build_helix

Construct spiral structures like staircases, DNA models, or towers in Minecraft Bedrock. Define center coordinates, radius, height, turns, and optional parameters like axis, direction, and chirality for precise customization.

Instructions

Build HELIX/SPIRAL: spiral staircase, corkscrew, DNA model, twisted tower. Requires: centerX,centerY,centerZ,radius,height,turns. Optional: axis,direction,chirality

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionNoBuild action to performbuild
axisNoHelix axis direction: x (east-west), y (up-down), z (north-south)y
centerXYesCenter X coordinate
centerYYesBottom Y coordinate
centerZYesCenter Z coordinate
chiralityNoHelix handedness: right (clockwise from growth direction), left (counter-clockwise)right
clockwiseNoRotation direction: true=clockwise (right-hand spiral), false=counter-clockwise (left-hand spiral)
directionNoGrowth direction along axis: positive or negativepositive
heightYesHow tall the spiral is (total vertical height). Short=10, Medium=25, Tall=50. Each turn uses height/turns blocks vertically
materialNoBlock type to build with (e.g. stairs for actual staircases, stone for pillars, glowstone for decorative spirals)minecraft:stone
radiusYesHow wide the spiral is (distance from center). Small spiral=3, Medium=8, Large=15. Larger radius = wider staircases
turnsYesHow many complete rotations. Few turns=gentle slope (1-2), Many turns=steep spiral (5-10). 0.5=half turn, 1.5=one and half turns

Implementation Reference

  • The main handler function that executes the build_helix tool. Validates inputs, calculates 3D helix positions, checks limits, and uses optimized build executor to place blocks in spiral structure.
    async execute(args: {
        action?: string;
        centerX: number;
        centerY: number;
        centerZ: number;
        radius: number;
        height: number;
        turns: number;
        material?: string;
        clockwise?: boolean;
        axis?: 'x' | 'y' | 'z';
        direction?: 'positive' | 'negative';
        chirality?: 'right' | 'left';
    }): Promise<ToolCallResult> {
        try {
            // Socket-BE API接続確認
            if (!this.world) {
                return { success: false, message: "World not available. Ensure Minecraft is connected." };
            }
    
            // 引数の基本検証
            if (!args || typeof args !== 'object') {
                return this.createErrorResponse('Invalid arguments provided');
            }
    
            if (!this.validateArgs(args)) {
                return this.createErrorResponse('Missing required arguments: centerX, centerY, centerZ, radius, height, turns');
            }
    
            const { 
                action = 'build',
                centerX, 
                centerY, 
                centerZ, 
                radius, 
                height, 
                turns, 
                material = 'minecraft:stone', 
                clockwise = true,
                axis = 'y',
                direction = 'positive',
                chirality = 'right'
            } = args;
            
            // actionパラメータをサポート(現在は build のみ)
            if (action !== 'build') {
                return this.createErrorResponse(`Unknown action: ${action}. Only 'build' is supported.`);
            }
            
            // 座標の整数化
            const center = {
                x: this.normalizeCoordinate(centerX),
                y: this.normalizeCoordinate(centerY),
                z: this.normalizeCoordinate(centerZ)
            };
            
            const radiusInt = Math.round(radius);
            const heightInt = Math.round(height);
            
            // パラメータ検証
            if (radiusInt < 1 || radiusInt > 50) {
                return this.createErrorResponse('Radius must be between 1 and 50');
            }
            
            if (heightInt < 2 || heightInt > 100) {
                return this.createErrorResponse('Height must be between 2 and 100');
            }
            
            if (turns < 0.5 || turns > 20) {
                return this.createErrorResponse('Turns must be between 0.5 and 20');
            }
            
            // 座標範囲の検証(軸別対応)
            let minX, maxX, minY, maxY, minZ, maxZ;
            
            switch (axis) {
                case 'x':
                    minX = center.x;
                    maxX = center.x + heightInt - 1;
                    minY = center.y - radiusInt;
                    maxY = center.y + radiusInt;
                    minZ = center.z - radiusInt;
                    maxZ = center.z + radiusInt;
                    break;
                case 'z':
                    minX = center.x - radiusInt;
                    maxX = center.x + radiusInt;
                    minY = center.y - radiusInt;
                    maxY = center.y + radiusInt;
                    minZ = center.z;
                    maxZ = center.z + heightInt - 1;
                    break;
                case 'y':
                default:
                    minX = center.x - radiusInt;
                    maxX = center.x + radiusInt;
                    minY = center.y;
                    maxY = center.y + heightInt - 1;
                    minZ = center.z - radiusInt;
                    maxZ = center.z + radiusInt;
                    break;
            }
            
            if (!this.validateCoordinates(minX, minY, minZ) || 
                !this.validateCoordinates(maxX, maxY, maxZ)) {
                return this.createErrorResponse('Helix extends beyond valid coordinates');
            }
            
            // ブロックIDの正規化
            const blockId = this.normalizeBlockId(material);
            
            const commands: string[] = [];
            let blocksPlaced = 0;
            
            // 座標変換ヘルパー関数
            const transformCoordinates = (localX: number, localY: number, localZ: number): {x: number, y: number, z: number} => {
                const directionMultiplier = direction === 'positive' ? 1 : -1;
                const chiralityMultiplier = chirality === 'right' ? 1 : -1;
                
                switch (axis) {
                    case 'x':
                        // X軸らせん: YZ平面で回転、X方向に進行
                        return {
                            x: center.x + localY * directionMultiplier,
                            y: center.y + localX * chiralityMultiplier,
                            z: center.z + localZ * chiralityMultiplier
                        };
                    case 'z':
                        // Z軸らせん: XY平面で回転、Z方向に進行
                        return {
                            x: center.x + localX * chiralityMultiplier,
                            y: center.y + localZ * chiralityMultiplier,
                            z: center.z + localY * directionMultiplier
                        };
                    case 'y':
                    default:
                        // Y軸らせん(デフォルト): XZ平面で回転、Y方向に進行
                        return {
                            x: center.x + localX * chiralityMultiplier,
                            y: center.y + localY * directionMultiplier,
                            z: center.z + localZ * chiralityMultiplier
                        };
                }
            };
            
            // 3D Bresenham風螺旋アルゴリズム(候補点3つの決定版)
            const totalAngle = turns * 2 * Math.PI; // 総回転角度(ラジアン)
            const rotationDirection = clockwise ? 1 : -1; // 回転方向
            
            const placedPositions = new Set<string>();
            
            // 螺旋の現在位置(ループ内で更新)
            
            // 螺旋の座標を計算
            const positions = calculateHelixPositions(
                center, 
                heightInt, 
                radiusInt, 
                turns, 
                axis as 'x' | 'y' | 'z'
            );
            
            // ブロック数制限チェック
            if (positions.length > BUILD_LIMITS.HELIX) {
                return this.createErrorResponse(`Too many blocks to place (maximum ${BUILD_LIMITS.HELIX.toLocaleString()})`);
            }
            
            try {
                // 最適化されたビルド実行
                const result = await executeBuildWithOptimization(
                    this.world,
                    positions,
                    blockId,
                    {
                        type: 'helix',
                        center: center,
                        radius: radiusInt,
                        height: heightInt,
                        turns: turns,
                        material: blockId,
                        clockwise: clockwise,
                        axis: axis,
                        direction: direction,
                        chirality: chirality,
                        apiUsed: 'Socket-BE'
                    }
                );
                
                if (!result.success) {
                    return this.createErrorResponse(result.message);
                }
                
                return {
                    success: true,
                    message: result.message,
                    data: result.data
                };
            } catch (buildError) {
                return this.createErrorResponse(`Building error: ${buildError instanceof Error ? buildError.message : String(buildError)}`);
            }
    
        } catch (error) {
            return this.createErrorResponse(
                `Error building helix: ${error instanceof Error ? error.message : String(error)}`
            );
        }
    }
  • Input schema defining parameters for helix building: center coordinates, radius, height, turns, material, direction options.
    readonly inputSchema: InputSchema = {
        type: 'object',
        properties: {
            action: {
                type: 'string',
                description: 'Build action to perform',
                enum: ['build'],
                default: 'build'
            },
            centerX: {
                type: 'number',
                description: 'Center X coordinate'
            },
            centerY: {
                type: 'number',
                description: 'Bottom Y coordinate'
            },
            centerZ: {
                type: 'number',
                description: 'Center Z coordinate'
            },
            radius: {
                type: 'number',
                description: 'How wide the spiral is (distance from center). Small spiral=3, Medium=8, Large=15. Larger radius = wider staircases',
                minimum: 1,
                maximum: 50
            },
            height: {
                type: 'number',
                description: 'How tall the spiral is (total vertical height). Short=10, Medium=25, Tall=50. Each turn uses height/turns blocks vertically',
                minimum: 2,
                maximum: 100
            },
            turns: {
                type: 'number',
                description: 'How many complete rotations. Few turns=gentle slope (1-2), Many turns=steep spiral (5-10). 0.5=half turn, 1.5=one and half turns',
                minimum: 0.5,
                maximum: 20
            },
            material: {
                type: 'string',
                description: 'Block type to build with (e.g. stairs for actual staircases, stone for pillars, glowstone for decorative spirals)',
                default: 'minecraft:stone'
            },
            clockwise: {
                type: 'boolean',
                description: 'Rotation direction: true=clockwise (right-hand spiral), false=counter-clockwise (left-hand spiral)',
                default: true
            },
            axis: {
                type: 'string',
                description: 'Helix axis direction: x (east-west), y (up-down), z (north-south)',
                enum: ['x', 'y', 'z'],
                default: 'y'
            },
            direction: {
                type: 'string',
                description: 'Growth direction along axis: positive or negative',
                enum: ['positive', 'negative'],
                default: 'positive'
            },
            chirality: {
                type: 'string',
                description: 'Helix handedness: right (clockwise from growth direction), left (counter-clockwise)',
                enum: ['right', 'left'],
                default: 'right'
            }
        },
        required: ['centerX', 'centerY', 'centerZ', 'radius', 'height', 'turns']
    };
  • src/server.ts:369-369 (registration)
    Registration of BuildHelixTool instance in the tools array during server initialization.
    new BuildHelixTool(), // ✅ 修正完了
  • src/server.ts:19-19 (registration)
    Import statement for BuildHelixTool class.
    import { BuildHelixTool } from "./tools/advanced/building/build-helix";
  • Class definition declaring the tool name 'build_helix'.
    export class BuildHelixTool extends BaseTool {
        readonly name = 'build_helix';
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states what parameters are required/optional. It doesn't disclose behavioral traits like whether this is a destructive operation (likely yes, given it's a build tool), what permissions are needed, rate limits, or what happens when invoked (e.g., immediate construction, preview mode).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured in two sentences: first stating purpose with examples, second listing parameters. Every element serves a purpose with zero waste, though it could be slightly more polished in formatting.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 12-parameter build tool with no annotations and no output schema, the description is minimally adequate. It covers the basic purpose and parameter categories but lacks important context about the tool's behavior, side effects, and relationship to other build tools, leaving significant gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 12 parameters thoroughly. The description adds minimal value by listing which parameters are required vs optional but provides no additional semantic context beyond what's in the schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool builds HELIX/SPIRAL structures with specific examples (spiral staircase, corkscrew, DNA model, twisted tower), which distinguishes it from sibling tools like build_cube, build_sphere, etc. The verb 'Build' is explicit and the resource 'HELIX/SPIRAL' is well-defined.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like build_cylinder or build_torus for similar curved structures. It lists required and optional parameters but gives no context about appropriate use cases or comparisons with sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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/Mming-Lab/minecraft-bedrock-mcp-server'

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