Skip to main content
Glama

learn_layout

Map {label: {role, name}} descriptors to live element handle IDs for the current session, then reuse those IDs in sequences to skip repeated find_elements calls.

Instructions

Resolve semantic names to live element handle IDs for the current session.

Pass a map of {label: {role, name}} and get back {label: handle_id}. Store the result and use the handle IDs in run_sequence to skip repeated find_elements calls. Re-call after app restarts or window recreation.

Example: learn_layout("1234", { "bold_button": {"role": "push button", "name": "Bold"}, "editor": {"role": "document", "name": ""}, })

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": {
      "window_id": "<window_id>",
      "descriptors": "<descriptors>"
    },
    "name": "learn_layout"
  }
}

Input Schema

NameRequiredDescriptionDefault
window_idYes
descriptorsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior3/5

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

With no annotations, the description carries the full burden and does disclose useful behavior: handles are session-scoped and go stale on app restart or window recreation, and the return shape is {label: handle_id}. It omits what happens when a descriptor matches nothing or matches multiple elements, which matters for an unannotated tool.

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?

Purpose, return contract, lifecycle rule, and example are front-loaded in that order with no filler. The example earns its space because it disambiguates a nested schema that is otherwise opaque.

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?

Strong for a two-parameter tool with a poorly typed nested parameter and no output schema, since the return shape and staleness rules are covered. The remaining gap is failure behavior for unmatched or ambiguous descriptors.

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

Parameters4/5

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

Schema description coverage is 0% and descriptors is an untyped additionalProperties object, so the description must compensate. It does so well by spelling out the {label: {role, name}} nesting and giving a concrete example, though window_id's origin (e.g. list_windows) is only hinted at by the '1234' example.

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?

States a specific verb and resource ('Resolve semantic names to live element handle IDs') and scopes it to the current session. It also implicitly distinguishes itself from find_elements by framing itself as the thing that avoids repeated find_elements calls.

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?

Tells the agent exactly what to do with the result ('Store the result and use the handle IDs in run_sequence to skip repeated find_elements calls') and when to invalidate it ('Re-call after app restarts or window recreation'). It stops short of an explicit when-not-to-use case, e.g. one-off lookups where find_elements alone suffices.

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