Skip to main content
Glama

Playwright Server MCP

by ziux

playwright_action

Automates web interactions by executing actions like clicks, inputs, and checks on elements using Playwright selectors. Supports complex tasks like drag-and-drop, screenshots, and JavaScript evaluations.

Instructions

根据给定的locator 和action 执行操作

Input Schema

NameRequiredDescriptionDefault
actionYes操作类型,可选项: fill,click,dblclick,hover,tap,check,uncheck,select_option,press,type,focus,blur,drag_to,screenshot,get_text,count,is_visible,is_enabled,is_hidden,is_disabled,is_checked,get_attribute,evaluate,wait_for,press_sequentially,clear,scroll_into_view,set_input_files,select_text,dispatch_event,get_inner_text,get_inner_html,get_content,all_inner_texts,all_text_contents
attribute_nameNo要获取的属性名称,用于get_attribute操作
buttonNo鼠标按钮,用于点击操作,可选: 'left', 'right', 'middle'
byYes选择元素方式,遵循playwright的选择器原则,可选项: get_by_text,get_by_placeholder,get_by_label,get_by_role,get_by_alt_text,get_by_title,get_by_test_id,get_by_css,locator
by_valueYes选择元素的值
delayNo按键之间的延迟(毫秒)
event_dataNo事件数据,JSON格式的字符串,用于dispatch_event操作
event_nameNo要分发的事件名称,用于dispatch_event操作
exactNo是否精确匹配文本
filenameNo截图保存的文件名,用于screenshot操作
filesNo要上传的文件路径,用于set_input_files操作,多个文件用逗号分隔
forceNo是否强制执行动作,无视actionability检查
has_textNo元素必须包含的文本
modifiersNo修饰键,用于键盘操作,可选: 'Alt', 'Control', 'Meta', 'Shift'
no_wait_afterNo是否不等待动作完成后的导航
optionsNo选择框的选项,用于select_option操作,JSON格式的字符串,可以包含 value, label, index
positionNo相对于元素的点击位置,格式为: 'x,y'
scriptNo要在元素上执行的JavaScript代码,用于evaluate操作
selectorNo拖拽目标元素的选择器,用于drag_to操作
stateNo等待的元素状态,用于wait_for操作,可选: 'attached', 'detached', 'visible', 'hidden'
strictNo是否严格匹配元素(如果找到多个元素是否报错)
timeoutNo操作超时时间(毫秒)
valueNo操作的值

Input Schema (JSON Schema)

{ "properties": { "action": { "description": "操作类型,可选项: fill,click,dblclick,hover,tap,check,uncheck,select_option,press,type,focus,blur,drag_to,screenshot,get_text,count,is_visible,is_enabled,is_hidden,is_disabled,is_checked,get_attribute,evaluate,wait_for,press_sequentially,clear,scroll_into_view,set_input_files,select_text,dispatch_event,get_inner_text,get_inner_html,get_content,all_inner_texts,all_text_contents", "type": "string" }, "attribute_name": { "description": "要获取的属性名称,用于get_attribute操作", "type": "string" }, "button": { "description": "鼠标按钮,用于点击操作,可选: 'left', 'right', 'middle'", "type": "string" }, "by": { "description": "选择元素方式,遵循playwright的选择器原则,可选项: get_by_text,get_by_placeholder,get_by_label,get_by_role,get_by_alt_text,get_by_title,get_by_test_id,get_by_css,locator", "type": "string" }, "by_value": { "description": "选择元素的值", "type": "string" }, "delay": { "description": "按键之间的延迟(毫秒)", "type": "number" }, "event_data": { "description": "事件数据,JSON格式的字符串,用于dispatch_event操作", "type": "string" }, "event_name": { "description": "要分发的事件名称,用于dispatch_event操作", "type": "string" }, "exact": { "description": "是否精确匹配文本", "type": "boolean" }, "filename": { "description": "截图保存的文件名,用于screenshot操作", "type": "string" }, "files": { "description": "要上传的文件路径,用于set_input_files操作,多个文件用逗号分隔", "type": "string" }, "force": { "description": "是否强制执行动作,无视actionability检查", "type": "boolean" }, "has_text": { "description": "元素必须包含的文本", "type": "string" }, "modifiers": { "description": "修饰键,用于键盘操作,可选: 'Alt', 'Control', 'Meta', 'Shift'", "type": "array" }, "no_wait_after": { "description": "是否不等待动作完成后的导航", "type": "boolean" }, "options": { "description": "选择框的选项,用于select_option操作,JSON格式的字符串,可以包含 value, label, index", "type": "string" }, "position": { "description": "相对于元素的点击位置,格式为: 'x,y'", "type": "string" }, "script": { "description": "要在元素上执行的JavaScript代码,用于evaluate操作", "type": "string" }, "selector": { "description": "拖拽目标元素的选择器,用于drag_to操作", "type": "string" }, "state": { "description": "等待的元素状态,用于wait_for操作,可选: 'attached', 'detached', 'visible', 'hidden'", "type": "string" }, "strict": { "description": "是否严格匹配元素(如果找到多个元素是否报错)", "type": "boolean" }, "timeout": { "description": "操作超时时间(毫秒)", "type": "number" }, "value": { "description": "操作的值", "type": "string" } }, "required": [ "by", "by_value", "action" ], "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/ziux/playwright-plus-python-mcp'

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