ok
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
The cursor-ide-browser is an MCP server that allows you to navigate the web and interact with the page. Use this for frontend/webapp development and testing code changes.
|
||||
|
||||
CORE WORKFLOW:
|
||||
1. Start by understanding the user's goal and what success looks like on the page.
|
||||
2. Use browser_tabs with action "list" to inspect open tabs and URLs before acting.
|
||||
3. Use browser_snapshot before any interaction to inspect the current page structure and obtain refs.
|
||||
4. Use browser_take_screenshot for standalone visual verification or screenshot-based coordinate clicks. For browser_mouse_click_xy, capture a fresh viewport screenshot for the same tab and then issue the click immediately using coordinates from that screenshot. Do not reuse older screenshot coordinates. If any other browser tool runs first, capture a new viewport screenshot before calling browser_mouse_click_xy.
|
||||
5. After any action that could change the page structure or URL (click, type, fill, fill_form, select, hover, press key, drag, browser_navigate, browser_navigate_back, wait, dialog response, or lazy-loaded scroll), take a fresh browser_snapshot before the next structural action unless you are certain the page did not change.
|
||||
|
||||
AGENTIC PAGE NAVIGATION:
|
||||
1. When you know the destination, use browser_navigate directly to that URL.
|
||||
2. Use browser_navigate_back for browser history. Keep track of the current URL from tool output or snapshot metadata so you can navigate directly when needed.
|
||||
3. Work top-down: identify the relevant page region, dialog, form, or menu in the snapshot first, then target a specific ref inside it.
|
||||
4. Prefer one deliberate action followed by verification over exploratory thrashing.
|
||||
5. Use browser_search to locate text before blindly scrolling through large pages.
|
||||
6. Use browser_hover to reveal tooltips, dropdown menus, or hidden content before interacting with revealed elements.
|
||||
7. Use browser_scroll with scrollIntoView: true before clicking elements that may be offscreen or obscured.
|
||||
8. Use browser_fill to replace existing content (works on both input fields and contenteditable elements) and browser_type to append text or trigger typing-related handlers.
|
||||
9. If multiple elements share the same role and name, choose the exact ref from the snapshot instead of guessing. Use [nth=N] only as a hint to tell duplicate elements apart.
|
||||
|
||||
AVOID RABBIT HOLES:
|
||||
1. Do not repeat the same failing action more than once without new evidence such as a fresh snapshot, a different ref, a changed page state, or a clear new hypothesis.
|
||||
2. IMPORTANT: If four attempts fail or progress stalls, stop acting and report what you observed, what blocked progress, and the most likely next step.
|
||||
3. Prefer gathering evidence over brute force. If the page is confusing, use browser_snapshot, browser_console_messages, browser_network_requests, or a screenshot to understand it before trying more actions.
|
||||
4. If you encounter a blocker such as login, passkey/manual user interaction, permissions, captchas, destructive confirmations, missing data, or an unexpected state, stop and report it instead of improvising repeated actions.
|
||||
5. Do not get stuck in wait-action-wait loops. Every retry should be justified by something newly observed.
|
||||
|
||||
CRITICAL - Lock/unlock workflow:
|
||||
1. browser_lock requires an existing browser tab - you CANNOT call browser_lock with action: "lock" before browser_navigate
|
||||
2. Correct order: browser_navigate -> browser_lock({ action: "lock" }) -> (interactions) -> browser_lock({ action: "unlock" })
|
||||
3. If a browser tab already exists (check with browser_tabs list), call browser_lock with action: "lock" FIRST before any interactions
|
||||
4. Only call browser_lock with action: "unlock" when completely done with ALL browser operations for this turn
|
||||
|
||||
IMPORTANT - Waiting strategy:
|
||||
When waiting for page changes (navigation, content loading, animations, etc.), prefer short incremental waits (1-3 seconds) with browser_snapshot checks in between rather than a single long wait. For example, instead of waiting 10 seconds, do: wait 2s -> snapshot -> check if ready -> if not, wait 2s more -> snapshot again. This allows you to proceed as soon as the page is ready rather than always waiting the maximum time.
|
||||
|
||||
PERFORMANCE PROFILING:
|
||||
- browser_profile_start/stop: CPU profiling with call stacks and timing data. Use to identify slow JavaScript functions.
|
||||
- Profile data is written to ~/.cursor/browser-logs/. Files: cpu-profile-{timestamp}.json (raw profile in Chrome DevTools format) and cpu-profile-{timestamp}-summary.md (human-readable summary).
|
||||
- IMPORTANT: When investigating performance issues, read the raw cpu-profile-*.json file to verify summary data. Key fields: profile.samples.length (total samples), profile.nodes[].hitCount (per-node hits), profile.nodes[].callFrame.functionName (function names). Cross-reference with the summary to confirm findings before making optimization recommendations.
|
||||
|
||||
VISION:
|
||||
- Snapshot and interaction tools can optionally attach a page screenshot by setting take_screenshot_afterwards: true. The screenshot provides visual context (layout, colors, state); the aria snapshot provides element refs required for targeting actions. Use both together: the screenshot shows what the page looks like, the snapshot tells you how to interact with it. Prefer refs from the snapshot for interactions; the one screenshot-based exception is browser_mouse_click_xy, which must use coordinates from a fresh viewport screenshot captured immediately before the click for that tab. Any other browser tool call invalidates that screenshot cache.
|
||||
|
||||
NOTES:
|
||||
- browser_snapshot returns snapshot YAML and is the main source of truth for page structure.
|
||||
- Refs are opaque handles tied to the latest browser_snapshot for that tab. If a ref stops working, take a fresh snapshot instead of guessing.
|
||||
- Native dialogs (alert/confirm/prompt) never block automation. By default, confirm() returns true and prompt() returns the default value. To test different responses, call browser_handle_dialog BEFORE the triggering action: use accept: false for "Cancel", or promptText: "value" for custom prompt input.
|
||||
- Iframe content is not accessible - only elements outside iframes can be interacted with.
|
||||
- For nested scroll containers, use browser_scroll with scrollIntoView: true before clicking elements that may be obscured.
|
||||
- When you stop to report a blocker, include the current page, the target you were trying to reach, the blocker you observed, and the best next action. If the blocker requires manual user interaction, ask the user to take over at that point rather than assuming it in advance.
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"serverIdentifier": "cursor-ide-browser",
|
||||
"serverName": "cursor-ide-browser"
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"name": "browser_click",
|
||||
"description": "Perform click on a web page. Supports single/double click, different mouse buttons, modifier keys, position offsets, and hold duration.",
|
||||
"arguments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"element": {
|
||||
"type": "string",
|
||||
"description": "Human-readable element description used to obtain permission to interact with the element"
|
||||
},
|
||||
"ref": {
|
||||
"type": "string",
|
||||
"description": "Exact target element reference from the page snapshot"
|
||||
},
|
||||
"doubleClick": {
|
||||
"type": "boolean",
|
||||
"description": "Whether to perform a double click instead of a single click"
|
||||
},
|
||||
"button": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"left",
|
||||
"right",
|
||||
"middle"
|
||||
],
|
||||
"description": "Mouse button to click. Defaults to \"left\"."
|
||||
},
|
||||
"modifiers": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Control",
|
||||
"Shift",
|
||||
"Alt",
|
||||
"Meta",
|
||||
"ControlOrMeta"
|
||||
]
|
||||
},
|
||||
"description": "Modifier keys to hold during click. \"ControlOrMeta\" uses Ctrl on Windows/Linux and Cmd on Mac."
|
||||
},
|
||||
"offsetX": {
|
||||
"type": "number",
|
||||
"description": "Horizontal offset from element's left edge in pixels. If omitted, clicks at horizontal center."
|
||||
},
|
||||
"offsetY": {
|
||||
"type": "number",
|
||||
"description": "Vertical offset from element's top edge in pixels. If omitted, clicks at vertical center."
|
||||
},
|
||||
"holdDurationMs": {
|
||||
"type": "number",
|
||||
"description": "Duration to hold the mouse button down before releasing, in milliseconds. Useful for long-press interactions. Defaults to 0 (immediate release)."
|
||||
},
|
||||
"viewId": {
|
||||
"type": "string",
|
||||
"description": "Target browser tab ID. If omitted, uses the last interacted tab."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"element",
|
||||
"ref"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "browser_console_messages",
|
||||
"description": "Returns all console messages",
|
||||
"arguments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"viewId": {
|
||||
"type": "string",
|
||||
"description": "Target browser tab ID. If omitted, uses the last interacted tab."
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "browser_drag",
|
||||
"description": "Perform a drag and drop operation. Drags from a source element to a target element or coordinates.",
|
||||
"arguments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"sourceRef": {
|
||||
"type": "string",
|
||||
"description": "Reference of the element to drag from"
|
||||
},
|
||||
"targetRef": {
|
||||
"type": "string",
|
||||
"description": "Reference of the element to drop onto"
|
||||
},
|
||||
"targetX": {
|
||||
"type": "number",
|
||||
"description": "X coordinate to drop at (relative to viewport). Use with targetY instead of targetRef for coordinate-based drops."
|
||||
},
|
||||
"targetY": {
|
||||
"type": "number",
|
||||
"description": "Y coordinate to drop at (relative to viewport). Use with targetX instead of targetRef for coordinate-based drops."
|
||||
},
|
||||
"viewId": {
|
||||
"type": "string",
|
||||
"description": "Target browser tab ID. If omitted, uses the last interacted tab."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"sourceRef"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "browser_fill",
|
||||
"description": "Clear and fill a value into an input element. Unlike browser_type which appends text, this clears the existing value first and sets the new value atomically. Use this when you want to replace the entire content of an input field.",
|
||||
"arguments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"element": {
|
||||
"type": "string",
|
||||
"description": "Human-readable element description used to obtain permission to interact with the element"
|
||||
},
|
||||
"ref": {
|
||||
"type": "string",
|
||||
"description": "Exact target element reference from the page snapshot"
|
||||
},
|
||||
"value": {
|
||||
"type": "string",
|
||||
"description": "Value to fill into the element (replaces any existing content)"
|
||||
},
|
||||
"viewId": {
|
||||
"type": "string",
|
||||
"description": "Target browser tab ID. If omitted, uses the last interacted tab."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"element",
|
||||
"ref",
|
||||
"value"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"name": "browser_fill_form",
|
||||
"description": "Fill multiple form fields at once. Each field uses ref + value. By default, each field is cleared before setting the new value.",
|
||||
"arguments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"fields": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"element": {
|
||||
"type": "string",
|
||||
"description": "Human-readable element description used to obtain permission to interact with the element"
|
||||
},
|
||||
"ref": {
|
||||
"type": "string",
|
||||
"description": "Exact target element reference from the page snapshot"
|
||||
},
|
||||
"value": {
|
||||
"type": "string",
|
||||
"description": "Value to fill into the field"
|
||||
},
|
||||
"clear": {
|
||||
"type": "boolean",
|
||||
"description": "Whether to clear existing content before filling. Defaults to true."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"element",
|
||||
"ref",
|
||||
"value"
|
||||
]
|
||||
}
|
||||
},
|
||||
"viewId": {
|
||||
"type": "string",
|
||||
"description": "Target browser tab ID. If omitted, uses the last interacted tab."
|
||||
},
|
||||
"take_screenshot_afterwards": {
|
||||
"type": "boolean",
|
||||
"description": "When true, takes a screenshot after the fill completes. Defaults to false."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"fields"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "browser_get_bounding_box",
|
||||
"description": "Get bounding box details for an element.",
|
||||
"arguments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"element": {
|
||||
"type": "string",
|
||||
"description": "Human-readable element description used to obtain permission to inspect the element"
|
||||
},
|
||||
"ref": {
|
||||
"type": "string",
|
||||
"description": "Exact target element reference from the page snapshot"
|
||||
},
|
||||
"viewId": {
|
||||
"type": "string",
|
||||
"description": "Target browser tab ID. If omitted, uses the last interacted tab."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"element",
|
||||
"ref"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "browser_handle_dialog",
|
||||
"description": "Configure how native browser dialogs (alert, confirm, prompt) are handled. Dialogs are non-blocking in this environment - they return immediately without showing a visible dialog. Use this tool BEFORE triggering an action that shows a dialog to configure what value it should return. Also returns recent dialog history.",
|
||||
"arguments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"accept": {
|
||||
"type": "boolean",
|
||||
"description": "For confirm() dialogs: true to simulate clicking OK (returns true), false to simulate clicking Cancel (returns false). Default behavior is true."
|
||||
},
|
||||
"promptText": {
|
||||
"type": "string",
|
||||
"description": "For prompt() dialogs: the text value to return. If not specified, prompt() returns the default value provided by the page."
|
||||
},
|
||||
"viewId": {
|
||||
"type": "string",
|
||||
"description": "Target browser tab ID. If omitted, uses the last interacted tab."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"accept"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "browser_highlight",
|
||||
"description": "Temporarily highlight an element for visual debugging.",
|
||||
"arguments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"element": {
|
||||
"type": "string",
|
||||
"description": "Human-readable element description used to obtain permission to inspect the element"
|
||||
},
|
||||
"ref": {
|
||||
"type": "string",
|
||||
"description": "Exact target element reference from the page snapshot"
|
||||
},
|
||||
"durationMs": {
|
||||
"type": "number",
|
||||
"description": "Highlight duration in milliseconds. Defaults to 2000."
|
||||
},
|
||||
"viewId": {
|
||||
"type": "string",
|
||||
"description": "Target browser tab ID. If omitted, uses the last interacted tab."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"element",
|
||||
"ref"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "browser_hover",
|
||||
"description": "Hover over element on page",
|
||||
"arguments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"element": {
|
||||
"type": "string",
|
||||
"description": "Human-readable element description used to obtain permission to interact with the element"
|
||||
},
|
||||
"ref": {
|
||||
"type": "string",
|
||||
"description": "Exact target element reference from the page snapshot"
|
||||
},
|
||||
"viewId": {
|
||||
"type": "string",
|
||||
"description": "Target browser tab ID. If omitted, uses the last interacted tab."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"element",
|
||||
"ref"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "browser_lock",
|
||||
"description": "Lock or unlock the browser to control whether the user can interact while you work. Set action to \"lock\" or \"unlock\". When locked, the user can still click \"Take Control\" to unlock if needed.",
|
||||
"arguments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"action": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"lock",
|
||||
"unlock"
|
||||
],
|
||||
"description": "Whether to lock or unlock the browser for user interaction."
|
||||
},
|
||||
"viewId": {
|
||||
"type": "string",
|
||||
"description": "Target browser tab ID. If omitted, uses the last interacted tab."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"action"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "browser_mouse_click_xy",
|
||||
"description": "Click left, middle, or right mouse button using coordinates from a fresh viewport screenshot captured immediately before this call for the same tab. Do not reuse older screenshot coordinates. If any other browser tool runs first, this call will fail until you capture a new viewport screenshot.",
|
||||
"arguments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"x": {
|
||||
"type": "number",
|
||||
"description": "X coordinate from the fresh viewport screenshot captured immediately before this call for this tab, measured in screenshot pixels."
|
||||
},
|
||||
"y": {
|
||||
"type": "number",
|
||||
"description": "Y coordinate from the fresh viewport screenshot captured immediately before this call for this tab, measured in screenshot pixels."
|
||||
},
|
||||
"button": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"left",
|
||||
"right",
|
||||
"middle"
|
||||
],
|
||||
"description": "Mouse button to click. Defaults to \"left\"."
|
||||
},
|
||||
"viewId": {
|
||||
"type": "string",
|
||||
"description": "Target browser tab ID. If omitted, uses the last interacted tab."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"x",
|
||||
"y"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "browser_navigate",
|
||||
"description": "Navigate to a URL. By default reuses an existing tab; set newTab: true to open in a new tab.",
|
||||
"arguments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"url": {
|
||||
"type": "string",
|
||||
"description": "The URL to navigate to"
|
||||
},
|
||||
"viewId": {
|
||||
"type": "string",
|
||||
"description": "Target browser tab ID. If omitted, uses the last interacted tab."
|
||||
},
|
||||
"position": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"active",
|
||||
"side"
|
||||
],
|
||||
"description": "IMPORTANT: Set to \"side\" if user mentions \"side\", \"beside\", \"side panel\", or \"side by side\". Opens browser in side editor group. Defaults to \"active\" (current editor group)."
|
||||
},
|
||||
"take_screenshot_afterwards": {
|
||||
"type": "boolean",
|
||||
"description": "When true, takes a screenshot after navigation completes. Defaults to false."
|
||||
},
|
||||
"newTab": {
|
||||
"type": "boolean",
|
||||
"description": "When true, creates a new tab before navigating instead of reusing an existing tab. Defaults to false."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"url"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "browser_navigate_back",
|
||||
"description": "Go back to the previous page in browser history. Returns an error if there is no previous page to navigate to.",
|
||||
"arguments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"viewId": {
|
||||
"type": "string",
|
||||
"description": "Target browser tab ID. If omitted, uses the last interacted tab."
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "browser_network_requests",
|
||||
"description": "Returns all network requests since loading the page",
|
||||
"arguments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"viewId": {
|
||||
"type": "string",
|
||||
"description": "Target browser tab ID. If omitted, uses the last interacted tab."
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "browser_press_key",
|
||||
"description": "Press a key on the keyboard. Supports key combinations with modifiers using \"+\" syntax.",
|
||||
"arguments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"key": {
|
||||
"type": "string",
|
||||
"description": "Key to press. Single keys: \"a\", \"Enter\", \"Escape\", \"Tab\", \"Backspace\", \"Delete\", \"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\", \"PageUp\", \"PageDown\", \"Home\", \"End\", \"F1\"-\"F12\", \"Space\". Key combinations with modifiers using \"+\": \"Control+s\", \"Ctrl+Shift+p\", \"Alt+Tab\", \"Meta+a\" (Cmd on Mac). Modifier aliases: Control/Ctrl, Shift, Alt/Option, Meta/Command/Cmd/Win."
|
||||
},
|
||||
"viewId": {
|
||||
"type": "string",
|
||||
"description": "Target browser tab ID. If omitted, uses the last interacted tab."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"key"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "browser_profile_start",
|
||||
"description": "Start CPU profiling to capture call stack timing data. Use browser_profile_stop to end profiling and get results.",
|
||||
"arguments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"viewId": {
|
||||
"type": "string",
|
||||
"description": "Target browser tab ID. If omitted, uses the last interacted tab."
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "browser_profile_stop",
|
||||
"description": "Stop CPU profiling and return the profile data including call stacks, timing, and samples.",
|
||||
"arguments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"viewId": {
|
||||
"type": "string",
|
||||
"description": "Target browser tab ID. If omitted, uses the last interacted tab."
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "browser_resize",
|
||||
"description": "Resize the browser window",
|
||||
"arguments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"width": {
|
||||
"type": "number",
|
||||
"description": "Width of the browser window"
|
||||
},
|
||||
"height": {
|
||||
"type": "number",
|
||||
"description": "Height of the browser window"
|
||||
},
|
||||
"viewId": {
|
||||
"type": "string",
|
||||
"description": "Target browser tab ID. If omitted, uses the last interacted tab."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"width",
|
||||
"height"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"name": "browser_scroll",
|
||||
"description": "Scroll the page or a specific element. Use this to bring elements into view, scroll to content, or navigate long pages. Can scroll in any direction by specifying delta values or using directional shortcuts.",
|
||||
"arguments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"ref": {
|
||||
"type": "string",
|
||||
"description": "Element reference to scroll into view, or to scroll within (for scrollable containers)"
|
||||
},
|
||||
"direction": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"up",
|
||||
"down",
|
||||
"left",
|
||||
"right"
|
||||
],
|
||||
"description": "Direction to scroll. Shorthand for setting deltaX/deltaY."
|
||||
},
|
||||
"amount": {
|
||||
"type": "number",
|
||||
"description": "Amount to scroll in pixels when using direction. Defaults to 300."
|
||||
},
|
||||
"deltaX": {
|
||||
"type": "number",
|
||||
"description": "Horizontal scroll amount in pixels. Positive scrolls right, negative scrolls left."
|
||||
},
|
||||
"deltaY": {
|
||||
"type": "number",
|
||||
"description": "Vertical scroll amount in pixels. Positive scrolls down, negative scrolls up."
|
||||
},
|
||||
"scrollIntoView": {
|
||||
"type": "boolean",
|
||||
"description": "If true and ref is provided, scrolls the element into view instead of scrolling within it. Defaults to true when ref is provided without delta values."
|
||||
},
|
||||
"viewId": {
|
||||
"type": "string",
|
||||
"description": "Target browser tab ID. If omitted, uses the last interacted tab."
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "browser_search",
|
||||
"description": "Search for text on the current page, similar to Cmd+F / Ctrl+F. Highlights all matches, scrolls to the first match, and returns a screenshot showing the match in context along with the count and positions of matches found.",
|
||||
"arguments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"query": {
|
||||
"type": "string",
|
||||
"description": "The text to search for on the page"
|
||||
},
|
||||
"caseSensitive": {
|
||||
"type": "boolean",
|
||||
"description": "Whether the search should be case-sensitive. Defaults to false."
|
||||
},
|
||||
"navigateToMatch": {
|
||||
"type": "number",
|
||||
"description": "Navigate to a specific match by index (0-based). If not provided, navigates to the first match."
|
||||
},
|
||||
"clearHighlights": {
|
||||
"type": "boolean",
|
||||
"description": "If true, clears all search highlights without performing a new search. Use this to remove previous search highlights."
|
||||
},
|
||||
"viewId": {
|
||||
"type": "string",
|
||||
"description": "Target browser tab ID. If omitted, uses the last interacted tab."
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "browser_select_option",
|
||||
"description": "Select an option in a dropdown. Matching priority: exact value match, then exact label match, then partial label match. The snapshot now shows available options for select elements.",
|
||||
"arguments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"element": {
|
||||
"type": "string",
|
||||
"description": "Human-readable element description used to obtain permission to interact with the element"
|
||||
},
|
||||
"ref": {
|
||||
"type": "string",
|
||||
"description": "Exact target element reference from the page snapshot"
|
||||
},
|
||||
"values": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "Array of values to select. Matches against option value first, then label text, then partial label. Use exact values from the snapshot options list when available."
|
||||
},
|
||||
"viewId": {
|
||||
"type": "string",
|
||||
"description": "Target browser tab ID. If omitted, uses the last interacted tab."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"element",
|
||||
"ref",
|
||||
"values"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "browser_snapshot",
|
||||
"description": "Capture accessibility snapshot of the current page, this is better than screenshot",
|
||||
"arguments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"viewId": {
|
||||
"type": "string",
|
||||
"description": "Target browser tab ID. If omitted, uses the last interacted tab."
|
||||
},
|
||||
"interactive": {
|
||||
"type": "boolean",
|
||||
"description": "When true, only include interactive elements in the snapshot. Defaults to false."
|
||||
},
|
||||
"maxDepth": {
|
||||
"type": "number",
|
||||
"description": "Maximum depth for snapshot output. Defaults to 20."
|
||||
},
|
||||
"compact": {
|
||||
"type": "boolean",
|
||||
"description": "When true, outputs a more compact snapshot format. Defaults to false."
|
||||
},
|
||||
"selector": {
|
||||
"type": "string",
|
||||
"description": "Optional CSS selector to scope the snapshot to a subtree."
|
||||
},
|
||||
"includeDiff": {
|
||||
"type": "boolean",
|
||||
"description": "When true, include a diff vs the previous snapshot for this tab. Defaults to false."
|
||||
},
|
||||
"take_screenshot_afterwards": {
|
||||
"type": "boolean",
|
||||
"description": "When true, takes a screenshot after snapshot completes. Defaults to false."
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "browser_tabs",
|
||||
"description": "List, create, close, or select a browser tab",
|
||||
"arguments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"action": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"list",
|
||||
"new",
|
||||
"close",
|
||||
"select"
|
||||
],
|
||||
"description": "Operation to perform"
|
||||
},
|
||||
"index": {
|
||||
"type": "number",
|
||||
"description": "Tab index. Required for \"select\". Optional for \"close\" (defaults to current tab)."
|
||||
},
|
||||
"position": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"active",
|
||||
"side"
|
||||
],
|
||||
"description": "IMPORTANT: Set to \"side\" if user mentions \"side\", \"beside\", \"side panel\", or \"side by side\". Opens browser in side editor group. Only for action \"new\". Defaults to \"active\"."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"action"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "browser_take_screenshot",
|
||||
"description": "Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.",
|
||||
"arguments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "Image format for the screenshot. Default is png."
|
||||
},
|
||||
"filename": {
|
||||
"type": "string",
|
||||
"description": "File name to save the screenshot to. Defaults to page-{timestamp}.{png|jpeg} if not specified."
|
||||
},
|
||||
"element": {
|
||||
"type": "string",
|
||||
"description": "Description of the element, if taking a screenshot of an element"
|
||||
},
|
||||
"ref": {
|
||||
"type": "string",
|
||||
"description": "CSS selector for the element, if taking a screenshot of an element"
|
||||
},
|
||||
"fullPage": {
|
||||
"type": "boolean",
|
||||
"description": "When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Cannot be used with element screenshots."
|
||||
},
|
||||
"viewId": {
|
||||
"type": "string",
|
||||
"description": "Target browser tab ID. If omitted, uses the last interacted tab."
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "browser_type",
|
||||
"description": "Type text into editable element",
|
||||
"arguments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"element": {
|
||||
"type": "string",
|
||||
"description": "Human-readable element description used to obtain permission to interact with the element"
|
||||
},
|
||||
"ref": {
|
||||
"type": "string",
|
||||
"description": "Exact target element reference from the page snapshot"
|
||||
},
|
||||
"text": {
|
||||
"type": "string",
|
||||
"description": "Text to type into the element"
|
||||
},
|
||||
"clear": {
|
||||
"type": "boolean",
|
||||
"description": "Whether to clear existing content before typing. Use this to replace the current value instead of appending to it. Defaults to false."
|
||||
},
|
||||
"submit": {
|
||||
"type": "boolean",
|
||||
"description": "Whether to submit entered text (press Enter after)"
|
||||
},
|
||||
"slowly": {
|
||||
"type": "boolean",
|
||||
"description": "Whether to type one character at a time. Useful for triggering key handlers in the page. By default entire text is filled in at once."
|
||||
},
|
||||
"viewId": {
|
||||
"type": "string",
|
||||
"description": "Target browser tab ID. If omitted, uses the last interacted tab."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"element",
|
||||
"ref",
|
||||
"text"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "browser_wait_for",
|
||||
"description": "Wait for text to appear or disappear, or wait a specified time. Note: time is in SECONDS, not milliseconds.",
|
||||
"arguments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"time": {
|
||||
"type": "number",
|
||||
"description": "Time to wait in SECONDS (e.g., 2 for 2 seconds, 0.5 for 500ms). Use for fixed delays."
|
||||
},
|
||||
"text": {
|
||||
"type": "string",
|
||||
"description": "Wait for this text to appear on the page."
|
||||
},
|
||||
"textGone": {
|
||||
"type": "string",
|
||||
"description": "Wait for this text to disappear from the page."
|
||||
},
|
||||
"timeout": {
|
||||
"type": "number",
|
||||
"description": "Maximum time to wait for text conditions in MILLISECONDS. Defaults to 30000 (30 seconds)."
|
||||
},
|
||||
"viewId": {
|
||||
"type": "string",
|
||||
"description": "Target browser tab ID. If omitted, uses the last interacted tab."
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user