Skip to main content
Glama

set_game_rule

Configure Minecraft server game rules like keepInventory or doDaylightCycle using RCON commands to customize gameplay mechanics and server behavior.

Instructions

Set a game rule value via RCON. Common rules: doDaylightCycle, doWeatherCycle, doMobSpawning, keepInventory, mobGriefing, doFireTick, randomTickSpeed, playersSleepingPercentage.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ruleYesGame rule name (e.g., 'keepInventory', 'doDaylightCycle')
valueYesGame rule value (e.g., 'true', 'false', '3')

Implementation Reference

  • The set_game_rule tool is defined and handled directly in src/tools/config-tools.ts. It takes a rule name and value as input and sends a 'gamerule' command via RCON.
    server.tool(
      "set_game_rule",
      "Set a game rule value via RCON. Common rules: doDaylightCycle, doWeatherCycle, doMobSpawning, keepInventory, mobGriefing, doFireTick, randomTickSpeed, playersSleepingPercentage.",
      {
        rule: z.string().describe("Game rule name (e.g., 'keepInventory', 'doDaylightCycle')"),
        value: z.string().describe("Game rule value (e.g., 'true', 'false', '3')"),
      },
      async ({ rule, value }) => {
        try {
          const response = await manager.rcon.send(`gamerule ${rule} ${value}`);
          return { content: [{ type: "text", text: response }] };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Failed to set game rule: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
            isError: true,
          };
        }
      }
    );
Behavior3/5

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

With no annotations provided, the description carries the disclosure burden. It reveals the RCON transport mechanism but omits critical behavioral details: whether changes are persistent, immediate effect vs restart-required, permission requirements, or error handling behavior.

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

Conciseness5/5

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

Two sentences with zero waste. The first sentence front-loads the action and mechanism; the second provides concrete examples. Every word earns its place.

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?

Adequate for a simple 2-parameter setter with no output schema. The mechanism (RCON) and domain examples provide sufficient context for invocation, but the absence of persistence guarantees, error behavior, or differentiation from execute_command leaves noticeable gaps.

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

Parameters4/5

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

While the schema has 100% description coverage, the description adds value by listing concrete examples of game rules (doDaylightCycle, keepInventory, etc.), grounding the agent in the Minecraft domain. However, it does not clarify value format differences between boolean and integer rules.

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 specific action (Set), resource (game rule value), and mechanism (via RCON). However, it does not explicitly distinguish from sibling tool get_game_rules or clarify that this is the write counterpart to that read operation.

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. It does not mention that execute_command could also set game rules, or that get_game_rules should be used to read current values before setting.

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