Skip to main content
Glama

focus

Destructive

Makes an element the keyboard input target without clicking, useful before typing in form fields or triggering JavaScript events tied to keyboard targeting.

Instructions

[Agent Browser] Set keyboard focus on an element without clicking. Use for form fields before typing, or to trigger focus-based JS events. Prefer fill() for inputs - it handles focus automatically.

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": {
      "selector": "<selector>"
    },
    "name": "focus"
  }
}

Input Schema

NameRequiredDescriptionDefault
selectorYes

Output Schema

NameRequiredDescriptionDefault
dataNo
hintsNo
messageNo
successNo
suggestionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare the safety profile (readOnlyHint=false, destructiveHint=true), so the bar is lower. The description adds real behavioral context beyond them: no click is dispatched, and focus-based JS event handlers may fire as a side effect. It doesn't explain why the tool is flagged destructive or what happens if the selector matches nothing, which keeps it short of a 5.

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?

Three short lines, each doing distinct work: action, use case, alternative. The primary action and the key qualifier ('without clicking') are front-loaded, with no filler or repetition.

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?

An output schema exists, so return values needn't be described, and the single-parameter surface is small. The remaining gap is selector syntax, which an agent must know to invoke the tool correctly and which is absent from both schema and description.

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 0% for the single 'selector' parameter, so the description carries the burden of explaining it. It only says 'on an element' and never clarifies whether the selector is a CSS selector, text match, or test-id, leaving the format to inference.

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 target: 'Set keyboard focus on an element without clicking.' The 'without clicking' qualifier sharply distinguishes it from click/fill siblings, and the description explicitly names fill() as the alternative for inputs.

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

Usage Guidelines5/5

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

Gives both a when-to-use ('form fields before typing', 'trigger focus-based JS events') and a when-not-to-use ('Prefer fill() for inputs - it handles focus automatically'). The routing decision is fully specified without needing the schema.

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