Skip to main content
Glama

set_block

Place a block at specified coordinates in a Minecraft world using the /setblock command. Define block type and placement mode to modify terrain or structures.

Instructions

Place a block at a specific position. Uses the /setblock command.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesX coordinate
yYesY coordinate
zYesZ coordinate
blockYesBlock ID (e.g., 'diamond_block', 'stone', 'oak_planks')
modeNoPlacement modereplace

Implementation Reference

  • The 'set_block' tool is defined and registered within the registerCommandTools function using server.tool. It accepts coordinates, a block ID, and a placement mode, then executes the '/setblock' command via RCON.
    server.tool(
      "set_block",
      "Place a block at a specific position. Uses the /setblock command.",
      {
        x: z.number().describe("X coordinate"),
        y: z.number().describe("Y coordinate"),
        z: z.number().describe("Z coordinate"),
        block: z
          .string()
          .describe("Block ID (e.g., 'diamond_block', 'stone', 'oak_planks')"),
        mode: z
          .enum(["destroy", "keep", "replace"])
          .optional()
          .default("replace")
          .describe("Placement mode"),
      },
      async ({ x, y, z: zCoord, block, mode }) => {
        try {
          const response = await manager.rcon.send(
            `setblock ${x} ${y} ${zCoord} ${block} ${mode}`
          );
          return { content: [{ type: "text", text: response }] };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Failed: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
            isError: true,
          };
        }
      }
    );
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It only mentions the underlying '/setblock' command name but fails to explain the destructive nature of the operation, the behavior of different placement modes, or what occurs when coordinates are invalid/occupied.

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 two-sentence description is appropriately sized and front-loaded with the core action. The second sentence identifying the underlying command provides useful implementation context without excessive verbosity.

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 5-parameter mutation tool with no annotations and no output schema, the description lacks critical context. It omits explanation of the placement modes, safety/destructive warnings, and success/failure return behaviors that would be necessary for safe agent operation.

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?

With 100% schema description coverage, the schema already documents all parameters adequately (coordinates, block ID examples, and mode enum values). The description mentions 'specific position' which aligns with the coordinate parameters but adds no additional syntax or format details beyond the comprehensive schema.

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 places a single block at a specific position, using a specific verb and resource. The phrase 'specific position' implicitly distinguishes this from the sibling 'fill_blocks' tool (which likely handles areas), though it doesn't explicitly contrast them.

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 'fill_blocks' or 'execute_command'. It also fails to explain when to use each mode enum value (destroy/keep/replace) or provide any selection criteria.

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

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/tamo2918/Minecraft-Server-MCP'

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