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

build_torus

Generate donuts, rings, circular fountains, or arena seating in Minecraft Bedrock Edition by defining center coordinates, major and minor radii, and optional axis alignment. Supports hollow or solid structures using specified block materials.

Instructions

Build TORUS: donut, ring, circular fountain, arena seating, portal. Requires: centerX,centerY,centerZ,majorRadius,minorRadius. Optional: axis

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionNoBuild action to performbuild
axisNoTorus axis (normal to the plane): x (YZ-plane torus), y (XZ-plane torus), z (XY-plane torus)y
centerXYesCenter X coordinate
centerYYesCenter Y coordinate
centerZYesCenter Z coordinate
hollowNoMake it hollow (true) for ring shell only, or solid (false) for full torus structure
majorRadiusYesOuter ring size (how big the overall donut is). Small ring=8, Medium ring=15, Large ring=30. This determines the donut hole size
materialNoBlock type to build with (e.g. stone for foundations, glass for decorative rings, water for fountains)minecraft:stone
minorRadiusYesTube thickness (how thick the donut ring is). Thin tube=2, Medium tube=4, Thick tube=8. Must be smaller than majorRadius

Implementation Reference

  • The execute method containing the core logic for the 'build_torus' tool: validates inputs, computes torus block positions, checks limits, and executes optimized building via Socket-BE API.
    async execute(args: {
        action?: string;
        centerX: number;
        centerY: number;
        centerZ: number;
        majorRadius: number;
        minorRadius: number;
        material?: string;
        hollow?: boolean;
        axis?: 'x' | 'y' | 'z';
    }): 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, majorRadius, minorRadius');
            }
    
            const { 
                action = 'build',
                centerX, 
                centerY, 
                centerZ, 
                majorRadius, 
                minorRadius, 
                material = 'minecraft:stone', 
                hollow = false,
                axis = 'y'
            } = 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 majorRadiusInt = Math.round(majorRadius);
            const minorRadiusInt = Math.round(minorRadius);
            
            // パラメータ検証
            if (majorRadiusInt < 3 || majorRadiusInt > 50) {
                return this.createErrorResponse('Major radius must be between 3 and 50');
            }
            
            if (minorRadiusInt < 1 || minorRadiusInt > 20) {
                return this.createErrorResponse('Minor radius must be between 1 and 20');
            }
            
            if (minorRadiusInt >= majorRadiusInt) {
                return this.createErrorResponse('Minor radius must be smaller than major radius');
            }
            
            // 座標範囲の検証
            const totalRadius = majorRadiusInt + minorRadiusInt;
            const minX = center.x - totalRadius;
            const maxX = center.x + totalRadius;
            const minY = center.y - minorRadiusInt;
            const maxY = center.y + minorRadiusInt;
            const minZ = center.z - totalRadius;
            const maxZ = center.z + totalRadius;
            
            if (!this.validateCoordinates(minX, minY, minZ) || 
                !this.validateCoordinates(maxX, maxY, maxZ)) {
                return this.createErrorResponse('Torus 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} => {
                switch (axis) {
                    case 'x':
                        // X軸トーラス: YZ平面でドーナツ、X軸が法線
                        return {
                            x: center.x + localY,  // Y(tube height) → X (axis direction)
                            y: center.y + localX,  // X(major radius) → Y
                            z: center.z + localZ   // Z(major radius) → Z
                        };
                    case 'z':
                        // Z軸トーラス: XY平面でドーナツ、Z軸が法線
                        return {
                            x: center.x + localX,  // X(major radius) → X
                            y: center.y + localZ,  // Z(major radius) → Y
                            z: center.z + localY   // Y(tube height) → Z (axis direction)
                        };
                    case 'y':
                    default:
                        // Y軸トーラス(デフォルト): XZ平面でドーナツ、Y軸が法線
                        return {
                            x: center.x + localX,  // X(major radius) → X
                            y: center.y + localY,  // Y(tube height) → Y (axis direction)
                            z: center.z + localZ   // Z(major radius) → Z
                        };
                }
            };
            
            
            // トーラスの座標を計算
            const positions = calculateTorusPositions(center, majorRadiusInt, minorRadiusInt, hollow);
            
            // ブロック数制限チェック
            if (positions.length > BUILD_LIMITS.TORUS) {
                return this.createErrorResponse(`Too many blocks to place (maximum ${BUILD_LIMITS.TORUS.toLocaleString()})`);
            }
            
            try {
                // 最適化されたビルド実行
                const result = await executeBuildWithOptimization(
                    this.world,
                    positions,
                    blockId,
                    {
                        type: 'torus',
                        center: center,
                        majorRadius: majorRadiusInt,
                        minorRadius: minorRadiusInt,
                        material: blockId,
                        hollow: hollow,
                        axis: axis,
                        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 torus: ${error instanceof Error ? error.message : String(error)}`
            );
        }
    }
  • Input schema defining parameters for the build_torus tool, including required center coordinates, radii, and optional material, hollow, axis.
    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: 'Center Y coordinate'
            },
            centerZ: {
                type: 'number',
                description: 'Center Z coordinate'
            },
            majorRadius: {
                type: 'number',
                description: 'Outer ring size (how big the overall donut is). Small ring=8, Medium ring=15, Large ring=30. This determines the donut hole size',
                minimum: 3,
                maximum: 50
            },
            minorRadius: {
                type: 'number',
                description: 'Tube thickness (how thick the donut ring is). Thin tube=2, Medium tube=4, Thick tube=8. Must be smaller than majorRadius',
                minimum: 1,
                maximum: 20
            },
            material: {
                type: 'string',
                description: 'Block type to build with (e.g. stone for foundations, glass for decorative rings, water for fountains)',
                default: 'minecraft:stone'
            },
            hollow: {
                type: 'boolean',
                description: 'Make it hollow (true) for ring shell only, or solid (false) for full torus structure',
                default: false
            },
            axis: {
                type: 'string',
                description: 'Torus axis (normal to the plane): x (YZ-plane torus), y (XZ-plane torus), z (XY-plane torus)',
                enum: ['x', 'y', 'z'],
                default: 'y'
            }
        },
        required: ['centerX', 'centerY', 'centerZ', 'majorRadius', 'minorRadius']
    };
  • src/server.ts:368-368 (registration)
    Instantiation of BuildTorusTool added to the tools array for MCP registration.
    new BuildTorusTool(), // ✅ 修正完了
  • src/server.ts:18-18 (registration)
    Import statement for BuildTorusTool class.
    import { BuildTorusTool } from "./tools/advanced/building/build-torus";
  • Class definition with tool name 'build_torus'.
    export class BuildTorusTool extends BaseTool {
        readonly name = 'build_torus';
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Build TORUS' implies a creation/mutation operation, it doesn't describe what actually happens (e.g., whether blocks are placed in the world, if it's destructive to existing structures, permission requirements, or rate limits). The description lacks critical behavioral context for a building tool.

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: one stating purpose with examples, another listing parameters. However, the first sentence could be more focused by removing some redundant examples (e.g., 'donut, ring, circular fountain' convey similar concepts).

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

Completeness2/5

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

For a 9-parameter building tool with no annotations and no output schema, the description is insufficient. It doesn't explain what the tool actually produces (e.g., a 3D structure in the world), how it interacts with the environment, or what happens on execution. The parameter listing doesn't compensate for missing behavioral context.

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 9 parameters thoroughly. The description lists required parameters but adds minimal value beyond what's in the schema (e.g., it doesn't explain relationships between parameters or provide additional context not in parameter descriptions). Baseline 3 is appropriate when schema does heavy lifting.

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

Purpose4/5

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

The description clearly states the tool builds a torus with specific examples (donut, ring, etc.), providing a specific verb+resource. However, it doesn't explicitly differentiate from sibling tools like build_sphere or build_cylinder, which would require mentioning unique torus characteristics beyond the examples given.

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_sphere or build_cylinder. It lists required parameters but offers no context about appropriate use cases, prerequisites, or comparisons to 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