Skip to main content
Glama
AdsPower

AdsPower LocalAPI MCP Server

Official

evaluate-script

Execute JavaScript scripts within AdsPower browser profiles to automate interactions, modify page elements, or perform custom browser operations.

Instructions

Evaluate the script

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYesThe script to evaluate, eg: "document.querySelector('#username').value = 'test'"

Implementation Reference

  • The main handler function for the 'evaluate-script' tool, which evaluates the provided JavaScript script in the current browser page context using Puppeteer.
    async evaluateScript({ script }: EvaluateScriptParams) {
        browser.checkConnected();
        const result = await browser.pageInstance!.evaluate(script);
        return result;
    },
  • Zod schema defining the input for the evaluate-script tool, requiring a 'script' string parameter.
    evaluateScriptSchema: z.object({
        script: z.string().describe('The script to evaluate, eg: "document.querySelector(\'#username\').value = \'test\'"')
    }).strict(),
  • Registration of the 'evaluate-script' tool on the MCP server, linking name, description, schema, and wrapped handler.
    server.tool('evaluate-script', 'Evaluate the script', schemas.evaluateScriptSchema.shape,
        wrapHandler(automationHandlers.evaluateScript));
Behavior1/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but provides none. It doesn't indicate whether this is a read or write operation, what side effects might occur, what permissions are needed, or what the evaluation context is. For a tool that likely executes code in a browser environment, this lack of behavioral information is critically inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

While technically concise with just three words, this is under-specification rather than effective conciseness. The description fails to provide essential information that would help an agent understand and use the tool correctly. Every sentence should earn its place, but this description doesn't provide enough substance to justify even its minimal length.

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

Completeness1/5

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

Given the complexity of script evaluation (potentially executing arbitrary code in a browser context), no annotations, no output schema, and sibling tools suggesting browser automation, this description is completely inadequate. It doesn't explain what gets evaluated, in what context, what the return values might be, or any safety considerations. The description fails to provide the contextual completeness needed for effective tool use.

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?

The schema description coverage is 100%, with the single parameter 'script' well-documented in the schema. The description adds no additional parameter information beyond what the schema already provides. According to the scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no parameter information in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Evaluate the script' is a tautology that essentially restates the tool name. It doesn't specify what kind of script (JavaScript, browser automation, etc.), what context it runs in, or what 'evaluate' means in practical terms. While sibling tools suggest a browser automation context, the description itself provides no specific verb+resource combination or differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides absolutely no guidance about when to use this tool versus alternatives. It doesn't mention prerequisites, appropriate contexts, or relationships with sibling tools like 'execute-script' (if such existed) or other browser automation tools. The agent receives no usage direction from this description.

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

Install Server

Other Tools

Latest Blog Posts

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/AdsPower/local-api-mcp-typescript'

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