Skip to main content
Glama

focus_element

Move keyboard focus to a page element before sending key presses, enabling reliable interaction with custom widgets.

Instructions

Move keyboard focus to an element (needed before press_key on custom widgets)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scopeNo
by_textNo
selectorNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

A3.5/5.0
Behavior3/5

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

The description states the core behavior, moving keyboard focus, and adds one important behavioral dependency with press_key. However, there are no annotations and the description does not disclose side effects, failure behavior, visibility requirements, or whether focus changes are synchronous.

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?

The entire description is one front-loaded sentence that communicates the action and the key usage context with no wasted words. It is a model of concise, structured tool documentation.

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

Completeness2/5

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

The definition explains what the tool does and when to use it, but it is not complete enough for reliable invocation: three optional parameters are undocumented, and there is no output schema or annotations to clarify return/error behavior. An agent would need to guess how to construct valid calls.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema provides only parameter names (scope, by_text, selector) with zero descriptions, and the description never explains how an element is targeted or what scope means. With 0% schema description coverage, the description was expected to compensate but does not.

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 the specific action 'Move keyboard focus to an element' and immediately ties it to a real workflow: 'needed before press_key on custom widgets'. This clearly differentiates it from sibling interaction tools like click, hover, and press_key.

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?

The parenthetical 'needed before press_key on custom widgets' explicitly states a when-to-use condition, which is strong context for an agent. It does not mention exclusions or alternative tools for other cases, so it stops short of full routing guidance.

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