web_eval
Web automation · macOS · Windows
Effect: execute (strongest supported action). Status: gated.
Gated means the tool requires an installed app, a connected account, permission, or runtime availability. Check those requirements on the listed platform before using it.
macOS
Purpose
Runs arbitrary JavaScript in a web session and returns the last expression's value, which must be a plain JSON value (async code is not awaited: return JSON.stringify(...) or store the result and read it in a second call). Requires confirm=true; without it you get a preview of the code and nothing runs. Disabled when LMCP is in read-only mode. POWER-USER tool — a page could feed malicious code, so prefer web_find / web_read / web_extract for normal use.
Required inputs
js— JavaScript to evaluate on the page; the last expression's value is returned.
Permissions and confirmation
Explicit confirmation parameter: inspect the schema and tool description before any real call. The documentation example keeps confirm false. Obtain user authorization before performing the action.
- Use only the apps, accounts and resources authorized by the user on this platform. Consult this tool's platform-specific description for its connection and permission requirements; this catalog does not assert additional OAuth scopes or OS entitlements.
Full input schema — macOS
{
"properties": {
"confirm": {
"description": "Must be true to run the code. Without it, returns a preview and runs nothing.",
"type": "boolean"
},
"js": {
"description": "JavaScript to evaluate on the page; the last expression's value is returned.",
"type": "string"
},
"remember": {
"description": "With confirm: true, also stop asking for this kind of action from now on. Only when the person said so (\"don't ask again\"). The person can revoke it in LMCP or with set_always_allowed.",
"type": "boolean"
},
"session": {
"description": "Session name (default 'default').",
"type": "string"
}
},
"required": [
"js"
],
"type": "object"
}Documentation example
Do not execute this example. These concrete inputs refer to a fictional demonstration dataset. Resolve real handles and obtain user authorization before any real call.
{
"confirm": false,
"js": "document.title",
"session": "demo-browser"
}Windows
Purpose
Runs arbitrary JavaScript in a web session and returns the last expression's value. Requires confirm=true; without it you get a preview of the code and nothing runs. POWER-USER tool — a page could feed malicious code, so prefer web_find / web_read / web_extract for normal use.
Required inputs
js— JavaScript to evaluate on the page; the last expression's value is returned.
Permissions and confirmation
Explicit confirmation parameter: inspect the schema and tool description before any real call. The documentation example keeps confirm false. Obtain user authorization before performing the action.
- Use only the apps, accounts and resources authorized by the user on this platform. Consult this tool's platform-specific description for its connection and permission requirements; this catalog does not assert additional OAuth scopes or OS entitlements.
Full input schema — Windows
{
"properties": {
"confirm": {
"description": "Must be true to run the code. Without it, returns a preview and runs nothing.",
"type": "boolean"
},
"js": {
"description": "JavaScript to evaluate on the page; the last expression's value is returned.",
"type": "string"
},
"remember": {
"description": "With confirm=true, and only after the person said so: do this kind of action without asking from now on («don't ask me again»). The preview names the family.",
"type": "boolean"
},
"session": {
"description": "Session name (default 'default').",
"type": "string"
}
},
"required": [
"js"
],
"type": "object"
}Documentation example
Do not execute this example. These concrete inputs refer to a fictional demonstration dataset. Resolve real handles and obtain user authorization before any real call.
{
"confirm": false,
"js": "document.title",
"session": "demo-browser"
}