Evaluate a single Luau expression
eval-expressionEvaluate a single Luau expression on the active Roblox client and return its type plus encoded value, with pcall-guarded errors for safe, read-only quick reads.
Instructions
Evaluate ONE Luau expression on the active client and return its typeof plus an encoded value. Convenience wrapper over run-luau for quick reads like 'workspace.Gravity', '#game.Players:GetPlayers()', or 'game.PlaceId'. The expression is pcall-guarded, so a runtime error is reported as { ok = false, error } instead of failing the call. Pass an expression, not statements (no 'return', no ';'). Note: this is PURE Luau — to compose with other server tools (e.g. mcp.getPlayers(), mcp.searchInstances({...})) use the script tool instead. Signature: { expression: string }. Phase: observe; cost=medium; idempotency=read-only. Requires: active-client. Produces: structured-result. Safety: read-only. On failure: inspect tool-schema for exact fields, defaults, constraints, and an invocation example.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expression | Yes | A single Luau expression to evaluate (e.g. 'workspace.Gravity', 'game.PlaceId'). |