Skip to main content
Glama

focus_window

Activate a specific application window by matching its title, enabling automated workflows that require window switching before performing actions.

Instructions

Bring a window to the foreground by partial title match (case-insensitive). Use when a tool does not accept a windowTitle param, or when you need to switch focus before a sequence of actions. Use chromeTabUrlContains to activate a specific Chrome/Edge tab by URL substring before focusing — only the active tab's title appears in get_windows. If CDP is unavailable, chromeTabUrlContains is silently skipped — check response.hints.warnings. Returns WindowNotFound if no match exists; call get_windows to see available titles. Caveats: On some apps focus may be immediately stolen back (modal dialogs, UAC prompts) — verify with get_context after focusing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesPartial window title to search for (case-insensitive)
chromeTabUrlContainsNoWhen set, activate the Chrome/Edge tab whose URL contains this substring before focusing the window. Requires Chrome/Edge running with --remote-debugging-port (default 9222). Use this when the target is a Chrome tab that is not currently active — the active tab title is the only one visible in the window title list.
cdpPortNoCDP port for chromeTabUrlContains (default 9222)
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It does this well by detailing constraints (e.g., 'case-insensitive', 'only the active tab's title appears in get_windows'), error handling ('Returns WindowNotFound if no match exists'), warnings ('check response.hints.warnings'), and caveats ('On some apps focus may be immediately stolen back'). However, it lacks explicit rate limit or permission requirements, preventing a perfect score.

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?

The description is appropriately sized and front-loaded, starting with the core purpose and key usage scenarios. Each sentence adds value, such as explaining Chrome tab handling, error returns, and caveats. It could be slightly more concise by integrating some details, but overall it avoids redundancy and is well-structured.

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?

Given the tool's complexity (3 parameters, no output schema, no annotations), the description is largely complete. It covers purpose, usage, behavioral traits, and caveats. The main gap is the lack of output schema, so return values are not explicitly detailed, though error handling is mentioned. This is sufficient but not exhaustive.

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 100%, so the schema already documents all parameters thoroughly. The description adds some context by explaining the interplay between chromeTabUrlContains and get_windows, but it does not provide significant additional semantic meaning beyond what the schema descriptions offer. This meets the baseline for high schema coverage.

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 explicitly states the tool's purpose: 'Bring a window to the foreground by partial title match (case-insensitive).' It specifies the verb ('bring'), resource ('window'), and mechanism ('partial title match'), clearly distinguishing it from sibling tools like get_windows (which lists windows) or get_active_window (which retrieves the currently focused window).

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?

The description provides explicit guidance on when to use this tool: 'Use when a tool does not accept a windowTitle param, or when you need to switch focus before a sequence of actions.' It also offers alternatives: 'call get_windows to see available titles' and mentions using chromeTabUrlContains for Chrome/Edge tabs. This covers both use cases and exclusions effectively.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Harusame64/desktop-touch-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server