Skip to main content
Glama

tv_evaluate

Run custom JavaScript on a Smart TV app to inspect state, perform assertions, or restore localStorage after a debug session. Supports promises and any configured device.

Instructions

Run arbitrary JavaScript in the app page and return the value (escape hatch). Use for custom assertions, reading app state, or restoring localStorage after a debug relaunch. Old TVs are Chrome 38 — keep the expression ES5.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deviceNoDevice id from devices.json. Omit to use the default device.
expressionYesJS expression to evaluate in the page.
awaitPromiseNoAwait a returned promise (default true).
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses the arbitrary JavaScript execution nature and 'escape hatch' status, indicating a powerful and potentially side-effectful operation. It also adds the ES5 compatibility constraint for old TVs, which affects how expressions must be written.

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?

The description is three concise sentences front-loaded with the primary function, followed by use cases and a constraint. It contains no filler and every sentence contributes necessary information.

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?

The tool is complex (arbitrary code execution) with three parameters and no output schema. The description covers the main purpose, usage contexts, and an important environmental constraint, which is enough for an agent to select and invoke it correctly. It doesn't detail error behavior, but that is not critical for selection.

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 coverage is 100%, so the baseline is 3. The description adds value by noting the ES5 constraint for the expression parameter and giving concrete use cases (e.g., localStorage restoration) that clarify expected expression semantics, going beyond the bare schema descriptions.

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 tool runs arbitrary JavaScript in the app page and returns the value, positioning it as an 'escape hatch.' This verb+resource+output structure distinguishes it from sibling tools like tv_state or tv_console, which focus on other actions.

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 description explicitly lists use cases: 'custom assertions, reading app state, or restoring localStorage after a debug relaunch.' It frames the tool as an escape hatch, implying use when standard tools don't suffice, though it doesn't name specific alternatives or exclusions.

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/Ediand11/tv-debug-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server