Skip to main content
Glama

perception_register

Register a live state tracker for a window or browser tab to verify target identity, focus, and safety before performing actions like typing or clicking, reducing screenshot round trips.

Instructions

Purpose: Register a perception lens, a lightweight live state tracker for one window or browser tab. Use it before repeated actions so later tool calls can verify target identity, focus, readiness, modal obstruction, and click safety without taking another screenshot. Details: Returns a lensId that can be passed to action tools such as keyboard_type, keyboard_press, mouse_click, browser_click_element, and browser_navigate. When a tool receives lensId, desktop-touch refreshes the tracked state, evaluates safety guards, and attaches a compact post.perception envelope to the response. The envelope reports attention, guard status, recent changes, and the latest known target state, reducing get_context/screenshot round trips. Prefer: Use for multi-step workflows on the same app window or browser tab, especially before typing, clicking coordinates, navigating browser tabs, or acting after focus may have changed. It is most useful when mistakes would be costly, such as typing into the wrong window or clicking stale coordinates. Caveats: A lens is not a visual recognition model. It tracks structured state from Win32, CDP, and optional UIA sensors. safe.clickCoordinates checks window bounds, not pixel-level occlusion. browserTab lenses require Chrome/Edge with --remote-debugging-port=9222. If attention is dirty, stale, settling, guard_failed, or identity_changed, follow the suggested action before continuing. Maximum 16 active lenses are kept; old lenses may be evicted. Examples: perception_register({name:'editor', target:{kind:'window', match:{titleIncludes:'Visual Studio Code'}}}) → {lensId:'perc-1'} keyboard_type({windowTitle:'Visual Studio Code', text:'hello', lensId:'perc-1'}) → response includes post.perception perception_read({lensId:'perc-1'}) → force a fresh envelope when attention is dirty/stale perception_forget({lensId:'perc-1'}) → release tracking when the workflow is done

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesHuman-readable name for this lens (e.g. 'target-editor'). Helps identify it in perception_list.
targetYesTarget entity to track. 'window' targets use Win32; 'browserTab' targets use CDP.
maintainNoFluents to keep alive. Defaults to all fluents; irrelevant kinds for the target type are silently ignored (e.g., browser.* fluents are skipped on window lenses).
guardsNoGuards to evaluate before actions that pass this lensId. Defaults to all guards. Remove guards you don't need to reduce false blocks.
guardPolicyNoHow guard failures are handled. 'block' (default) returns {ok:false, code:'GuardFailed'}. 'warn' allows the action through and sets attention:'guard_failed' in the envelope.block
maxEnvelopeTokensNoMaximum token budget for the perception envelope attached to tool responses. Fields are dropped in priority order when the budget is exceeded.
salienceNoLens salience hint. 'critical' lenses are refreshed more eagerly (future use).normal
Behavior4/5

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

With no annotations provided, the description carries full burden and does well: it explains the lensId return value, how tools use it to refresh state and attach perception envelopes, technical requirements (Chrome/Edge with remote debugging), limitations (max 16 active lenses, eviction policy), and guard failure handling. It could improve by specifying error conditions or performance characteristics more explicitly.

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?

Well-structured with Purpose, Details, Prefer, Caveats, and Examples sections. Each sentence adds value, but it's moderately long (200+ words). Some technical details in caveats could be more concise, though they're informative. Front-loaded with clear purpose.

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?

For a complex tool with 7 parameters, no annotations, and no output schema, the description provides good context: explains return value (lensId), integration with other tools, usage patterns, and limitations. It could mention typical error cases or response format more explicitly, but covers most essential aspects given the complexity.

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 7 parameters thoroughly. The description doesn't add significant parameter-specific semantics beyond what's in the schema descriptions, though it contextually mentions 'name' and 'target' in examples. Baseline 3 is appropriate when schema does heavy lifting.

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 clearly states the purpose: 'Register a perception lens, a lightweight live state tracker for one window or browser tab.' It specifies the verb ('register') and resource ('perception lens'), and distinguishes from siblings by explaining this is a setup tool for enabling safety checks in later actions, unlike direct action tools like keyboard_type or mouse_click.

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 it: 'Use it before repeated actions...' and 'Prefer: Use for multi-step workflows on the same app window or browser tab, especially before typing, clicking coordinates, navigating browser tabs, or acting after focus may have changed.' It also mentions when not to use: 'It is most useful when mistakes would be costly...' and distinguishes from visual recognition models in caveats.

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