Skip to main content
Glama

Evaluate JavaScript in the client page

lol_eval
Destructive

Execute a JavaScript expression inside the League client CEF renderer to debug runtime state, automate in-page UI, or read internal properties not exposed via REST.

Instructions

Execute an arbitrary JavaScript expression within the League client Chromium Embedded Framework (CEF) renderer context and return the evaluated result. CRITICAL: Do NOT use lol_eval for LCU REST API calls (e.g. fetch('/lol-...')) or client state queries. For safe LCU REST queries, ALWAYS use lol_get or lol_request. For automated game actions (lobby, matchmaking, champ-select, runes), ALWAYS use lol_workflow_* tools. For safe DOM structure inspection, prefer lol_dom_query. Use lol_eval ONLY for advanced CEF runtime debugging, custom in-page UI automation, or reading internal renderer properties not exposed via REST. Behavior: Destructive and unsandboxed; bypasses the write allowlist by construction. Security: Gated by allowEval config flag (check lol_status); calls are refused if allowEval is false. Prerequisite: Requires active CDP connection enabled via Pengu Loader (required for CDP tools; not needed for REST/workflow tools).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYesA single valid JavaScript expression to evaluate (not a statement list), e.g. "window.location.href" or "document.title"
awaitPromiseNoWhether to await resolution if the evaluated expression returns a Promise (default: false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.6.0
    • changedInput schema / properties / awaitPromise / description
      Previous value: -"true to await a returned promise"New value: +"Whether to await resolution if the evaluated expression returns a Promise (default: false)"
    • changedInput schema / properties / expression / description
      Previous value: -"a JavaScript expression, not a statement list"New value: +"A single valid JavaScript expression to evaluate (not a statement list), e.g. \"window.location.href\" or \"document.title\""
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already flag destructive/openWorld/non-idempotent, but the description adds critical context beyond them: unsandboxed, bypasses the write allowlist by construction, gated by the allowEval config flag (directing the agent to check lol_status), and requires an active CDP connection via Pengu Loader. This is exactly the behavioral disclosure an agent needs before calling a dangerous tool.

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 purpose, then uses CRITICAL/Behavior/Security/Prerequisite labels to structure the warnings efficiently. It is long, but nearly every sentence carries distinct, decision-relevant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 2-param tool with full schema coverage, rich annotations, and no output schema, the description covers purpose, alternatives, destructive/unsandboxed nature, the config gate, and the CDP prerequisite. An agent has everything needed to invoke it correctly.

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%, with both `expression` and `awaitPromise` documented in the schema, so baseline is 3. The description implies single-expression evaluation and return of a result but adds no syntax or format detail beyond what the schema already provides.

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+resource: execute an arbitrary JavaScript expression in the CEF renderer context and return the result. It explicitly distinguishes itself from siblings by naming what it is NOT for (LCU REST calls, DOM inspection, REST state queries).

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?

Explicit when-to-use/when-not with named alternatives: lol_get/lol_request for REST, lol_workflow_* for game actions, lol_dom_query for DOM, and reserves lol_eval for CEF runtime debugging and custom in-page automation. Nothing is left to inference.

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