Skip to main content
Glama
Minecraft MCP Server

Minecraft MCP Server

Set Inventory

setInventory
DestructiveIdempotent

Set a specific hotbar or backpack slot for an entity or player, validating the item and stack count; use air or count 0 to clear that slot.

Instructions

Set one inventory slot of an entity or player. section is "hotbar" (slots 0-8) or "inventory" (backpack, slots 0-26). The item is validated against the item registry and the count must fit the item stack size. Use "minecraft:air" or count 0 to clear a slot. The target is an entity UUID or a player name.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "target": "<target>",
      "slot": "<slot>",
      "item": "<item>"
    },
    "name": "setInventory"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemYesItem id, such as "minecraft:diamond_sword" or "diamond_sword". Use "minecraft:air" or count 0 to clear the slot.
slotYesSlot index within the section (hotbar 0-8, backpack 0-26)
countNoStack count (1 to the item stack size); 0 clears the slot
targetYesEntity UUID or player name (player names are case-insensitive)
sectionNo"hotbar" for the 9 hotbar slots or "inventory" for the 27 backpack slotsinventory

Output Schema

NameRequiredDescriptionDefault
itemYes
slotYes
entityYes
hotbarYes
sectionYes
previousYes
inventoryYes
usedSlotsYes
hotbarUsedYes
totalSlotsYes
inventoryUsedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.1

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=true and openWorldHint=false; the description adds real context beyond them by disclosing item-registry validation, the stack-size constraint on count, and the air/zero clearing convention. It stops short of stating that any existing item in the slot is overwritten or what happens on validation failure, but with annotations carrying the safety profile this is solid.

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?

Three tight sentences, front-loaded with the core action, then section semantics, then validation and clearing rules. The slot ranges repeat the schema and could be trimmed, but nothing is wasted or buried.

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

Completeness4/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 full schema coverage, annotations, and an output schema, the description covers target identification, section scoping, validation, and the clearing idiom. The remaining gap is overwrite semantics on an already-occupied slot, which matters given the destructive hint.

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?

Schema coverage is 100%, so the baseline is 3, but the description contributes a cross-parameter rule the schema never states: count must fit the stack size of the chosen item. It also restates the section slot ranges and target formats, which duplicate schema content, so the gain is real but modest.

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?

States a specific verb and resource ('Set one inventory slot of an entity or player') and immediately defines the two section scopes, so the operation is unambiguous. It does not, however, name any sibling (e.g. clearInventory or swapInventorySlots) to sharpen the boundary between similar write tools.

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

Usage Guidelines3/5

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

Gives clear operative guidance for the clearing case ('Use "minecraft:air" or count 0 to clear a slot'), which implicitly overlaps with clearInventory, but never says when to prefer this tool over that sibling or when not to use it. Usage is implied rather than spelled out against alternatives.

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