Skip to main content
Glama

get_element_context

Fetch complete context for one UI element—HTML, page, computed styles, ranked source files, and an edit prompt—before changing it. Use a stored comment thread or the current live selection.

Instructions

Full context for one element: the element, the page, its key computed styles, the ranked source files that probably render it, and a ready-made edit prompt. Pass thread_id to work from a stored comment, or nothing to use the latest live selection. Call this before editing anything.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
thread_idNoWork from a stored comment instead of a live selection.
selection_idNoA specific selection by correlation id (see get_selection_history). Omit for the most recent.
include_promptNoInclude the edit prompt. Defaults to true.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.14.1

TDQS

A4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It usefully describes the return bundle (element, page, styles, ranked sources, edit prompt) and that it is a read step preceding edits, but it discloses nothing about auth requirements, cost/rate limits, or how expensive the 'ranked source files' resolution is.

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?

Two tightly packed sentences: the first front-loads what the tool returns, the second gives the selection rule and the sequencing advice. No filler, no redundancy with structured fields.

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?

With no output schema, the description correctly takes on the job of telling the agent what comes back, and it does so thoroughly. It is nearly complete; only the absence of any note on behavior when no selection exists or on the meaning of 'ranked' keeps it from 5.

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 all three parameters (thread_id, selection_id, include_prompt) are already documented in the schema with meanings and defaults. The description's parameter handling restates the thread_id behavior rather than adding format or edge-case detail, so baseline 3 applies.

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 states a specific verb and resource ('Full context for one element') and enumerates exactly what 'context' means: the element, the page, computed styles, ranked source files, and an edit prompt. This clearly separates it from siblings like find_source_for_selection (which returns source files only) and get_latest_selection (which returns a selection only).

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?

It gives a concrete branching rule — pass thread_id to work from a stored comment, pass nothing to use the latest live selection — plus a sequencing directive ('Call this before editing anything'). It doesn't explicitly name a sibling as an alternative or state when not to use it, so it falls just short of 5.

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