Skip to main content
Glama

MCP Server for Crawl4AI

by omgwtfwow

execute_js

Execute JavaScript on web pages to extract data, trigger dynamic content, and check page state. Returns values from scripts with return statements while creating a new browser instance for each execution.

Instructions

[STATELESS] Execute JavaScript and get return values + page content. Creates new browser each time. Use for: extracting data, triggering dynamic content, checking page state. Scripts with "return" statements return actual values (strings, numbers, objects, arrays). Note: null returns as {"success": true}. Returns values but page state is lost. For persistent JS execution, use crawl with session_id.

Input Schema

NameRequiredDescriptionDefault
scriptsYesJavaScript to execute. Use "return" to get values back! Each string runs separately. Returns appear in results array. Examples: "return document.title", "return document.querySelectorAll('a').length", "return {url: location.href, links: [...document.links].map(a => a.href)}". Use proper JS syntax: real quotes, no HTML entities.
urlYesThe URL to load

Input Schema (JSON Schema)

{ "properties": { "scripts": { "description": "JavaScript to execute. Use \"return\" to get values back! Each string runs separately. Returns appear in results array. Examples: \"return document.title\", \"return document.querySelectorAll('a').length\", \"return {url: location.href, links: [...document.links].map(a => a.href)}\". Use proper JS syntax: real quotes, no HTML entities.", "items": { "type": "string" }, "type": [ "string", "array" ] }, "url": { "description": "The URL to load", "type": "string" } }, "required": [ "url", "scripts" ], "type": "object" }

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/omgwtfwow/mcp-crawl4ai-ts'

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