Skip to main content
Glama

craftos_key

Send named keystrokes to a running ComputerCraft emulator session, with optional Ctrl or Shift modifiers and timed key holds for repeats or terminate signals.

Instructions

Press a key by name (enter, backspace, up, down, left, right, tab, escape, f1..f12, a..z, ...), with ctrl:true or shift:true held around it. A tap of ctrl+t does not terminate, as in the game: pass holdMs to hold the key down instead (key repeats every tick), and holding ctrl+t for 1000 ms or more sends terminate.

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": {
      "id": "<id>",
      "key": "<key>"
    },
    "name": "craftos_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesId returned by craftos_session_create.
keyYesKey name, e.g. "enter", "up", "f1" or "c".
ctrlNoHold Ctrl around the key.
shiftNoHold Shift around the key.
holdMsNoHold the key this long instead of tapping it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.7.1
    • addedInput schema / properties / ctrl / description
      Added value: +"Hold Ctrl around the key."
    • addedInput schema / properties / key / description
      Added value: +"Key name, e.g. \"enter\", \"up\", \"f1\" or \"c\"."
    • addedInput schema / properties / shift / description
      Added value: +"Hold Shift around the key."
  2. First observedv0.7.0

TDQS

A4.2/5.0
Behavior5/5

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

Annotations only declare openWorldHint=false and destructiveHint=false; the description supplies the non-obvious behavior an agent could not infer: key repeat every tick while held, the fact that a tapped ctrl+t does not terminate, and the 1000 ms threshold that does send terminate. Those are precisely the side effects that would otherwise cause accidental session loss.

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 core action and key list are front-loaded, and every sentence carries information. The terminate clause is somewhat densely packed into one sentence ("A tap of ctrl+t does not terminate, as in the game..."), which takes a second read but wastes no space.

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 five-parameter input tool with no output schema, the description covers the key vocabulary, modifier semantics, hold behavior, repeat, and the single dangerous edge case. It omits what a call returns and what happens for an unrecognized key name, but those gaps are minor for this tool's complexity.

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 adds real meaning on top: ctrl/shift are described as being held around the key, and holdMs is characterized as hold-instead-of-tap with tick-level repeat rather than just 'hold duration'. That explains the interaction between holdMs and the ctrl+t terminate rule in a way the schema does not.

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 opens with a specific verb and resource ("Press a key by name") and enumerates the accepted key family (enter, backspace, arrows, tab, escape, f1..f12, a..z), which clearly separates key-press semantics from a text-typing sibling like craftos_type. It does not name an alternative tool explicitly, so sibling differentiation is implied 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 Guidelines4/5

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

It gives concrete selection guidance between two modes of the same tool: tap by default, or pass holdMs to hold the key down with per-tick repeat. It also flags the terminate threshold, telling the agent exactly which combination (ctrl+t for >=1000 ms) has session-ending consequences. No explicit exclusion pointing to a different tool is present.

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