Skip to main content
Glama

ui_evaluate

Runs custom JavaScript expressions inside the TradingView page context to access unexposed DOM properties or perform low-level browser automation.

Instructions

Evaluate arbitrary JavaScript expression directly in the TradingView page context. WHEN TO USE: Call for specialized low-level browser automation or retrieving unexposed DOM properties. SIDE EFFECTS: STATE_MUTATING (Arbitrary JavaScript execution in page context). LIMITATIONS: Advanced tool; expressions run within page sandbox.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYesJavaScript expression to evaluate in the page context. Wrap in IIFE for complex logic.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.9/5.0
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 and does disclose the crucial behavioral trait: SIDE EFFECTS: STATE_MUTATING via arbitrary JS in page context, plus a LIMITATIONS note about the page sandbox. It stops short of covering return behavior, error handling, or what happens when the expression throws.

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?

Front-loads the core purpose in one sentence, then uses labeled WHEN TO USE / SIDE EFFECTS / LIMITATIONS sections that are easy to scan. Tight and free of filler, though the sections are terse enough that some depth is traded for brevity.

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 one-parameter, output-schema-less execution tool, the description covers purpose, trigger context, mutation risk, and sandbox limitation. Nothing essential to invoking it correctly is missing, though the absence of return-value framing leaves a small gap.

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% and there is a single required parameter whose schema text already explains the IIFE-wrapping convention. The description adds no parameter-level detail beyond the schema, so the baseline 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?

States a specific verb (evaluate) and resource (arbitrary JavaScript expression in the TradingView page context), which is clear and self-contained. It does not explicitly name sibling tools like ui_click or ui_find_element, but the 'specialized low-level browser automation' framing implicitly separates it from the standard UI tools.

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?

The WHEN TO USE clause gives a concrete context: 'specialized low-level browser automation or retrieving unexposed DOM properties.' This tells the agent when the escape-hatch tool is warranted, though it names no explicit alternative or when-not-to-use condition.

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