Skip to main content
Glama

desktop_focus

Sets keyboard focus to a referenced macOS UI element before key presses, so keystrokes target the intended document area or control.

Instructions

Give a ref keyboard focus (e.g. a document area before pressing keys).

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": {
      "ref_id": "<ref_id>"
    },
    "name": "desktop_focus"
  }
}

Input Schema

NameRequiredDescriptionDefault
headedNo
ref_idYes
timeout_msNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the full behavioral burden, yet it says nothing about what happens if the ref is stale or missing, whether focus is stolen from another window, or how timeout_ms affects the operation. Only the basic effect is disclosed.

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?

A single short sentence with the effect front-loaded and an illustrative example appended. No wasted words, though the brevity contributes to the specification gaps noted elsewhere.

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?

For a 3-parameter mutation-style UI tool with no annotations and no output schema, the description omits parameter meanings, failure behavior, and interaction with the sibling window-focus tool. It is under-specified for the tool's complexity.

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

Parameters2/5

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

Schema description coverage is 0% for all three parameters. The description hints that 'ref' identifies a focusable target, but headed and timeout_ms are completely undocumented in both schema and description, leaving the agent to guess at their meaning and defaults.

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?

States a specific verb and resource: 'Give a ref keyboard focus,' with a concrete example (a document area before pressing keys). An agent understands the effect, though it does not distinguish itself from the sibling desktop_focus_window, so the boundary between element focus and window focus must be inferred.

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?

The parenthetical example implies usage (focus before sending keystrokes), which is useful context, but there is no explicit when-not guidance and no named alternative such as desktop_focus_window. Usage is implied rather than prescribed.

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