Skip to main content
Glama

focus

Brings a window to the foreground by matching a title or app name, or by an HWND returned by windows, so you can target the right app before acting.

Instructions

把窗口切到前台。

Input Schema

NameRequiredDescriptionDefault
windowYes窗口标题或应用名的一部分,或 windows 返回的 hwnd;不填就是前台窗口

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?

Annotations already declare readOnlyHint=false, destructiveHint=false, openWorldHint=false, so the safety profile is covered. The description adds nothing beyond them: it does not say what happens if the window is minimized, absent, or ambiguous, and it does not state whether focus steals input or fails silently. For a side-effecting window action, that gap is meaningful.

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?

It is a single short sentence with zero waste and the action is front-loaded. It borders on under-specification given what it omits, but nothing in it is redundant.

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

Completeness3/5

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

The tool is simple, has one parameter with full schema coverage, and has no output schema, so there is little that must be explained. Still, for an action with side effects on window state, the description should say more about failure modes and ordering relative to windows or click.

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 window parameter's accepted forms (title fragment, app name, or hwnd from windows) are already documented in the schema. The description adds no meaning beyond that, so the baseline of 3 applies.

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?

The description states a concrete action on a specific resource using a verb and resource (切到前台 / window), which an agent can easily distinguish from siblings such as click, move, or windows. It does not explicitly differentiate itself from the sibling status, but its purpose is clear.

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

Usage Guidelines2/5

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

The description gives no guidance on when to use focus rather than windows or status, no prerequisites, and no exclusions. An agent must infer that this is the call used to activate a window before sending input to it.

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