Edit Screen (change a formula you have)
edit_screenCHANGE a screener formula you already have — add, remove or replace conditions as ops; the server places,
resolves and merges them and checks the result (no engine JSON to write). Use it for EVERY change while building a
screen with the user; use screen_unified (mode 'run') when the user wants to SEE the stocks of a formula.
Returns {ok, criteria (the new formula, saved shape — screen_unified takes it verbatim in criteria), changes
(what each op became: status resolved|snapped, value, snaps / dropped / assumed = what the engine read differently),
issues (what did not go in: code, and nearest / candidates = alternatives ready to send back as an op's value),
keep (the user-set paths after the change), reset, charts (when conditions were split across charts), count?}.
Nothing is saved — the client decides what to apply.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"ops": "<ops>"
},
"name": "edit_screen"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ops | Yes | The changes, in order (1–8): ONE condition per op, written exactly as screen_unified takes it (same fields), plus WHERE it goes (op / target / step / rel). | |
| keep | No | Paths of values the USER set by hand ('ta.0.anchor.0.b', 'universe.include.0.country') — never overwritten or removed unless an op says user_asked. | |
| mode | No | 'check' = place, resolve and validate (fast, no market data) · 'count' = also how many stocks match the new formula (exact up to 500). | check |
| criteria | No | The formula to change, in the saved shape — the user's current formula or an `executed_criteria` / `criteria` a screen tool returned. Omit (or {}) to build from empty. |