Skip to main content
Glama
Minecraft MCP Server

Minecraft MCP Server

Swap Inventory Slots

swapInventorySlots

Swap any two hotbar or inventory slots for a Minecraft entity or player by specifying the target, sections, and slot indices to reorganize items.

Instructions

Swap two inventory slots of one entity or player. section is "hotbar" (slots 0-8) or "inventory" (backpack, slots 0-26). Both slots may be in the same or different sections. 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>",
      "fromSection": "<fromSection>",
      "fromSlot": "<fromSlot>",
      "toSection": "<toSection>",
      "toSlot": "<toSlot>"
    },
    "name": "swapInventorySlots"
  }
}

Input Schema

NameRequiredDescriptionDefault
targetYesEntity UUID or player name (player names are case-insensitive)
toSlotYesSecond slot index (hotbar 0-8, backpack 0-26)
fromSlotYesFirst slot index (hotbar 0-8, backpack 0-26)
toSectionYes"hotbar" or "inventory" for the second slot
fromSectionYes"hotbar" or "inventory" for the first slot

Output Schema

NameRequiredDescriptionDefault
entityYes
hotbarYes
toSlotYes
fromSlotYes
inventoryYes
toSectionYes
usedSlotsYes
hotbarUsedYes
previousToYes
totalSlotsYes
fromSectionYes
previousFromYes
inventoryUsedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.1

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare destructiveHint=false and idempotentHint=false, so the safety profile is covered. The description adds the cross-section capability (both slots may live in different sections), which is genuine behavioral context, but says nothing about empty slots, same-slot no-ops, or failure on an unknown target.

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?

Four short sentences, front-loaded with the operation and followed by the section model and target type. The section/slot explanation duplicates the schema wording almost verbatim, which costs a little space but keeps an agent's first read coherent.

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?

With an output schema present, return values need not be described, and annotations cover the safety profile. All five required parameters are addressed, leaving only minor gaps around edge-case behavior (swapping into/out of an empty slot, same from/to indices).

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 every parameter including slot ranges, enums, and the UUID-vs-player-name target. The description restates the same section/slot information without adding format, default, or edge-case meaning beyond it.

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?

"Swap two inventory slots of one entity or player" gives a specific verb and resource, and "swap" distinguishes it operationally from setInventory/clearInventory siblings. It never names a sibling tool explicitly, so the differentiation is inferred from the verb rather than stated.

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?

The definition explains the section model ("hotbar" 0-8, "inventory" 0-26) and that both slots may be in the same or different sections, which implies the tool's use cases. It gives no explicit when-to-use vs. when-not guidance and does not say when setInventory would be preferable to a swap.

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