Skip to main content
Glama
jumodada

DrissionPage MCP Server

by jumodada

Evaluate JavaScript

page_evaluate
Destructive

Execute a bounded JavaScript function body in the current page to retrieve JSON-safe results or modify page state.

Instructions

Run a bounded JavaScript function body in the current page and return a JSON-safe result. This can mutate the page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNoJSON arguments passed to the JavaScript function body
scriptYesJavaScript function body to run in the current page. Use return to provide a JSON-serializable result.
tab_idNoOptional MCP or native DrissionPage tab id. When omitted, the current tab is captured at call start.
max_charsNoMaximum serialized JSON characters returned in result

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.8.8
    • addedInput schema / properties / tab_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maxLength": 128,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Optional MCP or native DrissionPage tab id. When omitted, the current tab is captured at call start.",
      +  "title": "Tab Id"
      +}
    • changedOutput schema / oneOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "data": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "max_chars": {
      -            "title": "Max Chars",
      -            "type": "integer"
      -          },
      -          "non_finite_number": {
      -            "anyOf": [
      -              {
      -                "enum": [
      -                  "Infinity",
      -                  "-Infinity",
      -                  "NaN"
      -                ],
      -                "type": "string"
      -              },
      -              {
      -                "type": "null"
      -              }
      -            ],
      -            "default": null,
      -            "title": "Non Finite Number"
      -          },
      -          "original_json_chars": {
      -            "title": "Original Json Chars",
      -            "type": "integer"
      -          },
      -          "result": {
      -            "title": "Result"
      -          },
      -          "result_type": {
      -            "title": "Result Type",
      -            "type": "string"
      -          },
      -          "truncated": {
      -            "title": "Truncated",
      -            "type": "boolean"
      -          }
      -        },
      -        "required": [
      -          "result",
      -          "result_type",
      -          "truncated",
      -          "original_json_chars",
      -          "max_chars"
      -        ],
      -        "title": "PageEvaluateData",
      -        "type": "object"
      -      },
      -      "message": {
      -        "type": "string"
      -      },
      -      "ok": {
      -        "const": true
      -      }
      -    },
      -    "required": [
      -      "ok",
      -      "message",
      -      "data"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "data": {
      -        "additionalProperties": true,
      -        "type": "object"
      -      },
      -      "error": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "code": {
      -            "type": "string"
      -          },
      -          "details": {
      -            "additionalProperties": true,
      -            "type": "object"
      -          },
      -          "message": {
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "code",
      -          "message"
      -        ],
      -        "type": "object"
      -      },
      -      "message": {
      -        "type": "string"
      -      },
      -      "ok": {
      -        "const": false
      -      }
      -    },
      -    "required": [
      -      "ok",
      -      "message",
      -      "error"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "data": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "max_chars": {
      +            "title": "Max Chars",
      +            "type": "integer"
      +          },
      +          "non_finite_number": {
      +            "anyOf": [
      +              {
      +                "enum": [
      +                  "Infinity",
      +                  "-Infinity",
      +                  "NaN"
      +                ],
      +                "type": "string"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ],
      +            "default": null,
      +            "title": "Non Finite Number"
      +          },
      +          "original_json_chars": {
      +            "title": "Original Json Chars",
      +            "type": "integer"
      +          },
      +          "result": {
      +            "title": "Result"
      +          },
      +          "result_type": {
      +            "title": "Result Type",
      +            "type": "string"
      +          },
      +          "tab_id": {
      +            "description": "MCP tab id captured for this operation.",
      +            "maxLength": 128,
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "truncated": {
      +            "title": "Truncated",
      +            "type": "boolean"
      +          }
      +        },
      +        "required": [
      +          "result",
      +          "result_type",
      +          "truncated",
      +          "original_json_chars",
      +          "max_chars",
      +          "tab_id"
      +        ],
      +        "title": "PageEvaluateData",
      +        "type": "object"
      +      },
      +      "message": {
      +        "type": "string"
      +      },
      +      "ok": {
      +        "const": true
      +      }
      +    },
      +    "required": [
      +      "ok",
      +      "message",
      +      "data"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "data": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "error": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "code": {
      +            "type": "string"
      +          },
      +          "details": {
      +            "additionalProperties": true,
      +            "type": "object"
      +          },
      +          "message": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "code",
      +          "message"
      +        ],
      +        "type": "object"
      +      },
      +      "message": {
      +        "type": "string"
      +      },
      +      "ok": {
      +        "const": false
      +      }
      +    },
      +    "required": [
      +      "ok",
      +      "message",
      +      "error"
      +    ],
      +    "type": "object"
      +  }
      +]
  2. Changed1 schema field changedv0.8.0
    • changedOutput schema / oneOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "data": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "max_chars": {
      -            "title": "Max Chars",
      -            "type": "integer"
      -          },
      -          "original_json_chars": {
      -            "title": "Original Json Chars",
      -            "type": "integer"
      -          },
      -          "result": {
      -            "title": "Result"
      -          },
      -          "result_type": {
      -            "title": "Result Type",
      -            "type": "string"
      -          },
      -          "truncated": {
      -            "title": "Truncated",
      -            "type": "boolean"
      -          }
      -        },
      -        "required": [
      -          "result",
      -          "result_type",
      -          "truncated",
      -          "original_json_chars",
      -          "max_chars"
      -        ],
      -        "title": "PageEvaluateData",
      -        "type": "object"
      -      },
      -      "message": {
      -        "type": "string"
      -      },
      -      "ok": {
      -        "const": true
      -      }
      -    },
      -    "required": [
      -      "ok",
      -      "message",
      -      "data"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "data": {
      -        "additionalProperties": true,
      -        "type": "object"
      -      },
      -      "error": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "code": {
      -            "type": "string"
      -          },
      -          "details": {
      -            "additionalProperties": true,
      -            "type": "object"
      -          },
      -          "message": {
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "code",
      -          "message"
      -        ],
      -        "type": "object"
      -      },
      -      "message": {
      -        "type": "string"
      -      },
      -      "ok": {
      -        "const": false
      -      }
      -    },
      -    "required": [
      -      "ok",
      -      "message",
      -      "error"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "data": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "max_chars": {
      +            "title": "Max Chars",
      +            "type": "integer"
      +          },
      +          "non_finite_number": {
      +            "anyOf": [
      +              {
      +                "enum": [
      +                  "Infinity",
      +                  "-Infinity",
      +                  "NaN"
      +                ],
      +                "type": "string"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ],
      +            "default": null,
      +            "title": "Non Finite Number"
      +          },
      +          "original_json_chars": {
      +            "title": "Original Json Chars",
      +            "type": "integer"
      +          },
      +          "result": {
      +            "title": "Result"
      +          },
      +          "result_type": {
      +            "title": "Result Type",
      +            "type": "string"
      +          },
      +          "truncated": {
      +            "title": "Truncated",
      +            "type": "boolean"
      +          }
      +        },
      +        "required": [
      +          "result",
      +          "result_type",
      +          "truncated",
      +          "original_json_chars",
      +          "max_chars"
      +        ],
      +        "title": "PageEvaluateData",
      +        "type": "object"
      +      },
      +      "message": {
      +        "type": "string"
      +      },
      +      "ok": {
      +        "const": true
      +      }
      +    },
      +    "required": [
      +      "ok",
      +      "message",
      +      "data"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "data": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "error": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "code": {
      +            "type": "string"
      +          },
      +          "details": {
      +            "additionalProperties": true,
      +            "type": "object"
      +          },
      +          "message": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "code",
      +          "message"
      +        ],
      +        "type": "object"
      +      },
      +      "message": {
      +        "type": "string"
      +      },
      +      "ok": {
      +        "const": false
      +      }
      +    },
      +    "required": [
      +      "ok",
      +      "message",
      +      "error"
      +    ],
      +    "type": "object"
      +  }
      +]
  3. Changed1 schema field changedv0.7.2
    • changedOutput schema / oneOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "data": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "max_chars": {
      -            "type": "integer"
      -          },
      -          "original_json_chars": {
      -            "type": "integer"
      -          },
      -          "result": {},
      -          "result_type": {
      -            "type": "string"
      -          },
      -          "truncated": {
      -            "type": "boolean"
      -          }
      -        },
      -        "required": [
      -          "result",
      -          "result_type",
      -          "truncated",
      -          "original_json_chars",
      -          "max_chars"
      -        ],
      -        "title": "PageEvaluateData",
      -        "type": "object"
      -      },
      -      "message": {
      -        "type": "string"
      -      },
      -      "ok": {
      -        "const": true
      -      }
      -    },
      -    "required": [
      -      "ok",
      -      "message",
      -      "data"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "data": {
      -        "additionalProperties": true,
      -        "type": "object"
      -      },
      -      "error": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "code": {
      -            "type": "string"
      -          },
      -          "details": {
      -            "additionalProperties": true,
      -            "type": "object"
      -          },
      -          "message": {
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "code",
      -          "message"
      -        ],
      -        "type": "object"
      -      },
      -      "message": {
      -        "type": "string"
      -      },
      -      "ok": {
      -        "const": false
      -      }
      -    },
      -    "required": [
      -      "ok",
      -      "message",
      -      "error"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "data": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "max_chars": {
      +            "title": "Max Chars",
      +            "type": "integer"
      +          },
      +          "original_json_chars": {
      +            "title": "Original Json Chars",
      +            "type": "integer"
      +          },
      +          "result": {
      +            "title": "Result"
      +          },
      +          "result_type": {
      +            "title": "Result Type",
      +            "type": "string"
      +          },
      +          "truncated": {
      +            "title": "Truncated",
      +            "type": "boolean"
      +          }
      +        },
      +        "required": [
      +          "result",
      +          "result_type",
      +          "truncated",
      +          "original_json_chars",
      +          "max_chars"
      +        ],
      +        "title": "PageEvaluateData",
      +        "type": "object"
      +      },
      +      "message": {
      +        "type": "string"
      +      },
      +      "ok": {
      +        "const": true
      +      }
      +    },
      +    "required": [
      +      "ok",
      +      "message",
      +      "data"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "data": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "error": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "code": {
      +            "type": "string"
      +          },
      +          "details": {
      +            "additionalProperties": true,
      +            "type": "object"
      +          },
      +          "message": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "code",
      +          "message"
      +        ],
      +        "type": "object"
      +      },
      +      "message": {
      +        "type": "string"
      +      },
      +      "ok": {
      +        "const": false
      +      }
      +    },
      +    "required": [
      +      "ok",
      +      "message",
      +      "error"
      +    ],
      +    "type": "object"
      +  }
      +]
  4. Addedv0.5.1

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=true, openWorldHint=true, and idempotentHint=false, so the mutation risk is covered. The description adds 'bounded' and 'JSON-safe', which hint at execution limits and serialization constraints, but neither is quantified (no timeout, no sandbox detail), so it contributes modest extra context.

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

Conciseness5/5

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

Two short sentences, front-loaded with the core action and immediately followed by the mutation warning. No filler, no restatement of the tool name.

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

Completeness4/5

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

With an output schema present and annotations covering safety semantics, the description needs only to frame the operation, which it does. The main residual gap is what 'bounded' concretely means (time limit, sandbox scope) and how failures surface, which would help an agent decide whether a task is safely expressible here.

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?

Schema description coverage is 100%, so args, script, tab_id, and max_chars are already documented in the schema (including the return-statement requirement and the max_chars range). The description adds no parameter-level detail beyond that baseline.

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

Purpose5/5

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

States a specific verb (run/evaluate) and resource (JavaScript function body in the current page) plus the return shape (JSON-safe result). No sibling tool evaluates arbitrary JavaScript, so the scope is unambiguous within this server.

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

Usage Guidelines3/5

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

The description implies when this is relevant by noting the script runs against the current page and can mutate it, which is a useful caution. However, it never states when to prefer this over the structured element_*/page_* siblings, nor any precondition (e.g., page must be loaded, no navigation-in-progress).

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