Skip to main content
Glama

Send keys in sandbox

sandbox_type

Sends text or key chords to the focused window or targets a window by title or PID, enabling typed input and keyboard shortcuts for UI automation.

Instructions

Type text or send key chords to the focused window (or a window found by title/pid, which is focused first). With literal=false, uses SendKeys syntax: {ENTER}, {TAB}, ^s (Ctrl+S), %{F4} (Alt+F4).

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": {
      "keys": "<keys>"
    },
    "name": "sandbox_type"
  }
}

Input Schema

NameRequiredDescriptionDefault
pidNo
keysYes
literalNoTreat keys as plain text (default true).
windowTitleNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It does disclose a real side effect — the target window is focused first when found by title/pid — which is valuable. It omits the return behavior, whether it waits for or verifies keystroke delivery, and what happens if no window matches, leaving notable gaps for a mutation-like input tool.

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, front-loaded with the core action, then the targeting rule, then the syntax detail. Every clause carries information and the parenthetical examples are dense rather than redundant.

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 four-parameter tool with no annotations and no output schema, the definition covers the essentials: what it does, how the target is chosen, and the SendKeys escape syntax. It could still say how failures surface (no matching window, focus refusal) and whether delivery is synchronous.

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 only 25%, so the description must compensate, and it largely does: it explains literal=false as SendKeys syntax and gives concrete examples (^s for Ctrl+S, %{F4} for Alt+F4), plus what pid and windowTitle select. The keys parameter's per-character semantics when literal=true are still left implicit.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb pair and resource: 'Type text or send key chords to the focused window.' That is enough to separate it from mouse-oriented siblings like sandbox_click and from generic action siblings like sandbox_ui_action without opening any schema.

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?

It supplies useful operating context: by default keys go to the focused window, and if pid or windowTitle is passed the target window is focused first. It never states when to prefer this over a click/ui_action sibling or what preconditions must hold (e.g., window must exist), so usage is only implied.

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