Skip to main content
Glama

Press key

browser_press_key
Destructive

Press a keyboard key in the delegated tab. Supported keys: letters, digits, space, Enter, Tab, Escape, Backspace, Delete, ArrowUp, ArrowDown, ArrowLeft, ArrowRight, Home, End, PageUp, PageDown, Insert, F1–F12, and one other character such as ü. Distinct modifiers may prefix one key in any order (Shift+Control+ArrowLeft, Control+Shift+A, Control+Alt+Delete, Meta+c). Control and Ctrl are the same modifier. A repeated modifier is INVALID_ARGUMENT ("Duplicate modifier: Shift", "Duplicate modifier: Control"). An unknown token is INVALID_ARGUMENT ("Unknown key: Nope"). An empty part ("Shift+", "+A") or a modifier with no key (Shift, Shift+Control) is INVALID_ARGUMENT ("Chord is missing a key"). Those checks run before the tab is touched. Modifier chords do not insert text. elementId requires observationId (INVALID_ARGUMENT otherwise). Without elementId, the key goes to the focused element and the result includes target: { tag, id? }. A successful browser_type leaves focus on that field, so the next key without elementId reaches it. Tab and Shift+Tab move focus when the page does not cancel the key. A password, current-password, new-password, one-time-code, or cc-number field returns HUMAN_INPUT_REQUIRED for printable characters, Backspace, Delete, and Insert, and does not change the field. Tab, Enter, and Escape are still sent. ArrowUp and ArrowDown change input[type=number]. Text a number, date, time, or color input cannot hold returns INVALID_INPUT_VALUE and does not set the value. A non-ASCII character is inserted as text only on a field the agent may edit. Events are not isTrusted. Key presses are paced; RATE_LIMITED means wait retryAfterMs. On a sensitive site, press_key returns APPROVAL_REQUIRED with approvalId. After Deny, the next press_key returns APPROVAL_DENIED with that approvalId once, even with a new element id. A later key may ask again. After Approve, the completed success includes that same approvalId and approved: true. A key that did not need approval does not include approvalId.

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": {
      "sessionId": "<sessionId>",
      "key": "<key>"
    },
    "name": "browser_press_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyYes
elementIdNo
sessionIdYes
observationIdNo
idempotencyKeyNoA key replays the original result only within ~60 seconds of the first call, only for the same Mcp-Session-Id, the same credential (API key or OAuth token), the same browser session, and the same tool. After the window, or under a different session/credential/tool, the call executes and bills normally. Reusing a key with different arguments returns IDEMPOTENCY_KEY_REUSED and is not executed or billed. Refusals (e.g. NO_HISTORY_ENTRY) are not cached, so the same key re-executes once state changes. A key passed in _meta is ignored.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare a mutating, destructive, non-idempotent, open-world operation, and the description goes well beyond them: validation ordering ('Those checks run before the tab is touched'), sensitive-field behavior (HUMAN_INPUT_REQUIRED for password/one-time-code/cc-number, with Tab/Enter/Escape still sent), untrusted events, rate limiting with retryAfterMs, and a full approval lifecycle including APPROVAL_REQUIRED/APPROVAL_DENIED/approved: true and one-shot denial semantics.

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

Conciseness3/5

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

Purpose is front-loaded in the first sentence and most sentences carry distinct information, but the body is a dense, unsegmented block of run-on sentences mixing key grammar, focus rules, field-type constraints, rate limits and approvals. It would be materially easier to scan if grouped (key format / targeting / errors / approvals).

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

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, so the description must describe results — and it does: the target { tag, id? } on unfocused dispatch, approvalId/approved fields on approval flows, and the specific error codes with causes. Given five parameters, destructive semantics and an approval workflow, nothing an agent needs to invoke it correctly appears to be missing.

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 description coverage is only 20% (only idempotencyKey is documented), so the description must compensate — and it largely does, fully specifying key grammar (allowed keys, single-character rule, modifier ordering, duplicates, Control==Ctrl) and the elementId→observationId dependency. sessionId and observationId are covered only by implication ('delegated tab', the elementId dependency), leaving a small gap.

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?

States a specific verb and resource ('Press a keyboard key in the delegated tab') with explicit scope. It also delineates the boundary with the closest sibling in the list, browser_type, by explaining that a successful browser_type leaves focus on the field so a subsequent keypress without elementId lands there — an agent can distinguish the two tools without opening either schema.

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?

Gives concrete operational context: when to pass elementId (requires observationId), when to omit it (key goes to the focused element), and how focus carries over after browser_type. It stops short of an explicit 'use browser_type for text, use this for special keys and chords' routing statement, so the alternative-selection rule is inferred rather than stated.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.