mcp-browser-dev-tools 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -93,6 +93,40 @@ A `run_steps` call that dismisses a cookie banner if one is showing, fills in an
93
93
 
94
94
  The result has each step's outcome: which branch the `if` took, which `anyOf` alternative matched, and the message element with its text. Locators can be CSS, `text=`, `role=` with an accessible name, or `name=`. The full semantics of `run_steps`, `if`, `repeat`, and conditions are in [Tools](docs/tools.md#batched-steps).
95
95
 
96
+ ## Many Pages At Once
97
+
98
+ ![An AI agent sends one run_tabs call with four URLs, the browser loads and reads them side by side, and one reply comes back with every page's text](docs/images/run-tabs.svg)
99
+
100
+ A research step usually means opening several pages and reading each one. `read_text` with `links: true` collects the result links from a search page; then one `run_tabs` call opens them all and reads them side by side:
101
+
102
+ ```json
103
+ {
104
+ "browserFamily": "chromium",
105
+ "tabs": [
106
+ {
107
+ "url": "https://docs.example.com/a",
108
+ "steps": [{ "tool": "read_text", "arguments": { "maxChars": 4000 } }]
109
+ },
110
+ {
111
+ "url": "https://blog.example.com/b",
112
+ "steps": [{ "tool": "read_text", "arguments": { "maxChars": 4000 } }]
113
+ },
114
+ {
115
+ "url": "https://news.example.com/d",
116
+ "steps": [
117
+ { "tool": "wait_for", "arguments": { "selector": "article" } },
118
+ {
119
+ "tool": "read_text",
120
+ "arguments": { "selector": "article", "maxChars": 4000 }
121
+ }
122
+ ]
123
+ }
124
+ ]
125
+ }
126
+ ```
127
+
128
+ The result lists every tab in the order given, each with its steps' results: here, each page's main text, cut to `maxChars`. Each tab opens a new tab, loads its URL, and runs its steps at the same time as the others, so the call takes about as long as the slowest page; the tabs close afterwards. Steps are the same as in `run_steps`, including `if` and `repeat`, and a tab that fails or runs past its `timeoutMs` does not stop the others. `browserFamily` picks the browser for the new tabs when the server runs in its default `auto` mode. The details are in [Tools](docs/tools.md#several-tabs-at-once).
129
+
96
130
  ## Measured
97
131
 
98
132
  Model turns per task, median of 3 runs, from the benchmark in [PERFORMANCE.md](PERFORMANCE.md):
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-browser-dev-tools",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Browser MCP server for AI agents: batch actions, waits, and checks into one call on Chrome, Edge, or Firefox (CDP and WebDriver BiDi)",
5
5
  "author": "Hinaser <rindo.hinase@gmail.com>",
6
6
  "license": "MIT",
@@ -332,7 +332,7 @@ export class McpBrowserDevToolsServer {
332
332
  version: SERVER_VERSION,
333
333
  },
334
334
  instructions:
335
- 'Use the browser tools to inspect tabs, console output, network activity, DOM structure, element state, screenshots, and page interactions across Chromium CDP or Firefox BiDi. To act on a page and check the result, prefer run_steps: send the actions you already know (such as every field of a form), a wait_for, and the check (take_screenshot with output image, or inspect_element) in one call instead of several round trips, for example {"sessionId":"<id>","steps":[{"tool":"type","arguments":{"selector":"#search","text":"headphones"}},{"tool":"press_key","arguments":{"key":"Enter"}},{"tool":"wait_for","arguments":{"selector":"#results"}},{"tool":"take_screenshot","arguments":{"output":"image"}}]}. Add an if step when the page can be in more than one state.',
335
+ 'Use the browser tools to inspect tabs, console output, network activity, DOM structure, element state, screenshots, and page interactions across Chromium CDP or Firefox BiDi. To act on a page and check the result, prefer run_steps: send the actions you already know (such as every field of a form), a wait_for, and the check (take_screenshot with output image, or inspect_element) in one call instead of several round trips, for example {"sessionId":"<id>","steps":[{"tool":"type","arguments":{"selector":"#search","text":"headphones"}},{"tool":"press_key","arguments":{"key":"Enter"}},{"tool":"wait_for","arguments":{"selector":"#results"}},{"tool":"take_screenshot","arguments":{"output":"image"}}]}. Add an if step when the page can be in more than one state. To read several pages, open them together with run_tabs and read each with read_text. Locators: plain CSS (or css=) takes the first match; text=Foo takes the first visible element whose text equals Foo, else contains it, in document order, so it can match a wrapper; role=button[name="Save"] matches ARIA role and accessible name (equal or containing) without a visibility check; name=Foo takes the first visible element whose accessible name equals or contains Foo, and a matched <label> resolves to its control when that control is visible. Comparisons are case-sensitive; iframes and shadow roots are not searched.',
336
336
  });
337
337
  case "notifications/initialized":
338
338
  return null;
package/src/run-steps.mjs CHANGED
@@ -106,7 +106,7 @@ export function stepSchema(stepTools) {
106
106
  arguments: {
107
107
  type: "object",
108
108
  description:
109
- "That tool's arguments without sessionId (default {}). sleep takes { ms }. if takes { condition, then, elseIf, else }: each condition has the wait_for condition fields, checked once without waiting, all of which must hold; then and else are step lists; elseIf is a list of { condition, then } checked in order after condition, and the first condition that holds runs its then. repeat takes { steps, until, max }: runs steps, then checks the until condition once, and runs them again until it holds, at most max passes.",
109
+ "The tool's arguments without sessionId (default {}). sleep takes { ms }; if takes { condition, then, elseIf, else }; repeat takes { steps, until, max }.",
110
110
  },
111
111
  },
112
112
  required: ["tool"],
@@ -500,7 +500,7 @@ export function runStepsTool(runner, stepTools) {
500
500
  definition: {
501
501
  name: "run_steps",
502
502
  description:
503
- 'Run several tools on one attached session in order, in a single call. Use it to act and check the result together, for example [{"tool":"click","arguments":{"selector":"text=Save"}},{"tool":"sleep","arguments":{"ms":300}},{"tool":"take_screenshot"}]. Each step names a tool that takes sessionId (or sleep) and gives that tool\'s arguments without sessionId. To branch on the page state, use an if step, for example {"tool":"if","arguments":{"condition":{"selector":"#status","textIncludes":"failed"},"then":[{"tool":"click","arguments":{"selector":"text=Retry"}}],"elseIf":[{"condition":{"urlIncludes":"/login"},"then":[{"tool":"take_screenshot","arguments":{"output":"image"}}]}],"else":[]}}; conditions are checked once, in order, without waiting, so put wait_for or sleep before the if when the page may still be changing. The if result reports the branch taken (then, elseIf[i], or else), each checked condition with what was observed, and the branch\'s step results. Conditions and wait_for also take anyOf, a list of conditions of which any one must hold, to end on the first of several outcomes. To retry or poll, use a repeat step, for example {"tool":"repeat","arguments":{"max":5,"steps":[{"tool":"click","arguments":{"selector":"text=Load more"}},{"tool":"wait_for","arguments":{"selector":"#list","textExcludes":"Loading"}}],"until":{"selector":"text=Order #1042","state":"present"}}}; it runs its steps, checks until once without waiting, and runs them again until it holds, at most max passes (default 5, at most 10); it fails if until never holds or one of its steps fails, which ends the loop even with continueOnError, and its result lists each pass. Every step, including branches and repeat bodies, is validated before any runs. A step fails when its tool throws or reports found: false (except inspect_element). Stops at the first failing step unless continueOnError is true, and returns each step\'s result or error. When a step fails, the result also has page: the URL, title, and visible controls with a locator for each, to fix the batch without looking again. Screenshots come back as image content; the step result keeps the metadata plus image, the 1-based position of its image. Prefer wait_for over sleep when there is a condition to wait for.',
503
+ 'Run tools on one attached session in order, in a single call, to act and check the result together: [{"tool":"click","arguments":{"selector":"text=Save"}},{"tool":"wait_for","arguments":{"selector":"#status","textIncludes":"Saved"}},{"tool":"take_screenshot"}]. Each step names a tool that takes sessionId (or sleep) with that tool\'s arguments minus sessionId. if branches once, without waiting, on conditions with the wait_for fields: {"tool":"if","arguments":{"condition":{"selector":"text=Accept cookies"},"then":[...],"elseIf":[{"condition":{...},"then":[...]}],"else":[...]}}; the result reports the branch taken and what each condition observed. repeat retries or polls: {"tool":"repeat","arguments":{"steps":[...],"until":{"selector":"#list","textIncludes":"Order #1042"},"max":5}} runs its steps, then checks until once, at most max passes (default 5, at most 10); it fails if until never holds, and a failing step ends the loop. All steps are validated before any runs. A step fails when its tool throws or reports found: false (except inspect_element); the batch stops there unless continueOnError, and the result then includes page, the visible controls with a locator for each. Screenshots come back as image content; each step result keeps image, its 1-based position. Prefer wait_for over sleep.',
504
504
  inputSchema: runStepsInputSchema(stepTools),
505
505
  },
506
506
  handler: async (args) => runner.runSteps(args),
package/src/run-tabs.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { MAX_RUN_STEPS, stepSchema } from "./run-steps.mjs";
2
2
  import { asImageToolResult } from "./tool-results.mjs";
3
- import { waitUntilProperty } from "./tool-schemas.mjs";
3
+ import { waitUntilProperty, withoutDescriptions } from "./tool-schemas.mjs";
4
4
 
5
5
  export const MAX_TABS = 8;
6
6
  export const DEFAULT_TAB_TIMEOUT_MS = 60_000;
@@ -14,7 +14,7 @@ export function runTabsInputSchema(stepTools, browserFamily) {
14
14
  type: "array",
15
15
  minItems: 1,
16
16
  maxItems: MAX_TABS,
17
- description: `Tabs to run at the same time (at most ${MAX_TABS}). Each gives either url, to open a new tab there, or sessionId, to use an attached tab, plus the steps to run in it.`,
17
+ description: `At most ${MAX_TABS}, each with url (opens a new tab there) or sessionId (an attached tab), plus its steps.`,
18
18
  items: {
19
19
  type: "object",
20
20
  properties: {
@@ -33,7 +33,7 @@ export function runTabsInputSchema(stepTools, browserFamily) {
33
33
  type: "array",
34
34
  maxItems: MAX_RUN_STEPS,
35
35
  description: `Steps to run in this tab, as in run_steps (at most ${MAX_RUN_STEPS}, default none).`,
36
- items: stepSchema(stepTools),
36
+ items: withoutDescriptions(stepSchema(stepTools)),
37
37
  },
38
38
  },
39
39
  additionalProperties: false,
@@ -281,7 +281,7 @@ export function runTabsTool(runner, stepTools, configuredFamily) {
281
281
  {
282
282
  definition: {
283
283
  name: "run_tabs",
284
- description: `Run step lists in several tabs at the same time, in one call, and return every tab's results together. Use it to read or check several pages at once, for example to open search results side by side: {"tabs":[{"url":"https://example.com/a","steps":[{"tool":"read_text","arguments":{"maxChars":4000}}]},{"url":"https://example.com/b","steps":[{"tool":"read_text","arguments":{"maxChars":4000}}]}]}. A tab with url opens a new tab, loads the URL (waitUntil, default complete), and runs its steps; a tab with sessionId runs its steps in that attached tab. Steps are the same as in run_steps (including if and repeat) and are all validated before any tab opens. All tabs run at once by default (at most ${MAX_TABS}; concurrency lowers that); each has timeoutMs (default ${DEFAULT_TAB_TIMEOUT_MS}) and fails on its own without stopping the others, with page controls reported as in run_steps. Tabs opened for a url are closed afterwards unless keepTabs is true.`,
284
+ description: `Run step lists in several tabs at the same time and return every tab's results in one reply, for example to read search results side by side: {"tabs":[{"url":"https://example.com/a","steps":[{"tool":"read_text"}]},{"url":"https://example.com/b","steps":[{"tool":"read_text"}]}]}. A url tab opens a new tab, loads it, runs its steps, and closes unless keepTabs; a sessionId tab uses that attached tab. Steps are as in run_steps and are all validated first. Tabs run at once (at most ${MAX_TABS}; concurrency lowers that); each has timeoutMs (default ${DEFAULT_TAB_TIMEOUT_MS}) and fails without stopping the others.`,
285
285
  inputSchema: runTabsInputSchema(stepTools, configuredFamily),
286
286
  },
287
287
  handler: async (args) => runner.runTabs(args, configuredFamily),
@@ -32,7 +32,25 @@ export function sessionWithLimitSchema(description) {
32
32
  }
33
33
 
34
34
  export const LOCATOR_DESCRIPTION =
35
- 'Element locator. Plain CSS (or css=...) resolves to the first document.querySelector match. text=Foo resolves to the first visible element whose whitespace-normalized text equals Foo, falling back to the first whose text contains Foo; elements are scanned in document order, so this can resolve to a wrapper around the element you want. role=button or role=button[name="Save"] matches by explicit or implicit ARIA role and, optionally, accessible name (equal or containing), without a visibility check. name=Foo resolves to the first visible element whose accessible name (aria-label, aria-labelledby, associated label, alt, and so on) equals or contains Foo. Text comparisons are case-sensitive. Only the top-level document is searched: elements inside iframes or shadow roots are not found.';
35
+ 'Locator: CSS, text=Visible text, role=button[name="Save"], or name=Accessible name.';
36
+
37
+ // A copy of schema without descriptions, for a schema repeated inside another
38
+ // whose fields are already described once; validation is unchanged.
39
+ export function withoutDescriptions(schema) {
40
+ if (Array.isArray(schema)) {
41
+ return schema.map(withoutDescriptions);
42
+ }
43
+ if (!schema || typeof schema !== "object") {
44
+ return schema;
45
+ }
46
+ return Object.fromEntries(
47
+ Object.entries(schema)
48
+ .filter(
49
+ ([key, value]) => key !== "description" || typeof value !== "string",
50
+ )
51
+ .map(([key, value]) => [key, withoutDescriptions(value)]),
52
+ );
53
+ }
36
54
 
37
55
  export function selectorProperty() {
38
56
  return {
@@ -93,24 +111,24 @@ export function pageConditionProperties({ expression = false } = {}) {
93
111
  textEquals: {
94
112
  type: "string",
95
113
  description:
96
- "The selector's full visible text equals this string, comparing with whitespace collapsed. Requires selector; not with state hidden.",
114
+ "The selector's full visible text equals this, with whitespace collapsed. Requires selector; not with state hidden.",
97
115
  },
98
116
  textIncludes: {
99
117
  type: "string",
100
118
  description:
101
- "The selector's full visible text contains this string, comparing with whitespace collapsed. Requires selector; not with state hidden.",
119
+ "The selector's full visible text contains this, with whitespace collapsed. Requires selector; not with state hidden.",
102
120
  },
103
121
  textExcludes: {
104
122
  type: "string",
105
123
  description:
106
- "The selector's visible text does not contain this string, for example to wait until a status no longer says Processing. Never holds for a missing element. Requires selector; not with state hidden.",
124
+ "The selector's visible text no longer contains this, for example Processing; never holds for a missing element. Requires selector; not with state hidden.",
107
125
  },
108
126
  ...(expression
109
127
  ? {
110
128
  expression: {
111
129
  type: "string",
112
130
  description:
113
- "JavaScript expression evaluated in the page's main world; holds when its result, awaited if it is a promise, is truthy, for example document.querySelectorAll('.row').length >= 5. An expression that throws fails the check. Each evaluation must settle within the wait's remaining time, or 5000ms in if and repeat.",
131
+ "JavaScript in the page's main world; holds when its result (awaited if a promise) is truthy, for example document.querySelectorAll('.row').length >= 5. Throwing fails the check; each evaluation must settle within the remaining wait (5000ms in if and repeat).",
114
132
  },
115
133
  }
116
134
  : {}),
@@ -134,11 +152,11 @@ export function anyOfProperty(options) {
134
152
  minItems: 1,
135
153
  items: {
136
154
  type: "object",
137
- properties: pageConditionProperties(options),
155
+ properties: withoutDescriptions(pageConditionProperties(options)),
138
156
  additionalProperties: false,
139
157
  },
140
158
  description:
141
- "Alternative conditions, each with the fields above; holds when any one holds, checked in order. Use instead of the fields above, for example to wait until a status says either Paid or Declined. The result reports matchedIndex.",
159
+ "Alternative conditions with the fields above, instead of them; holds when any one holds, checked in order, for example a status of either Paid or Declined. The result reports matchedIndex.",
142
160
  };
143
161
  }
144
162
 
@@ -338,7 +356,7 @@ export function launchBrowserInputSchema(
338
356
  userDataDir: {
339
357
  type: "string",
340
358
  description:
341
- "Browser profile directory for a new launch (default: MCP_BROWSER_USER_DATA_DIR when set). Without either, Chromium and Edge get a fresh temporary profile if that browser is already running, and the default profile otherwise.",
359
+ "Profile directory for a new launch (default: MCP_BROWSER_USER_DATA_DIR). Without either, Chromium and Edge use a temporary profile if already running, else the default one.",
342
360
  },
343
361
  waitMs: {
344
362
  type: "integer",
@@ -404,7 +422,7 @@ export function ensureBrowserInputSchema(
404
422
  userDataDir: {
405
423
  type: "string",
406
424
  description:
407
- "Browser profile directory for a new launch (default: MCP_BROWSER_USER_DATA_DIR when set). Without either, Chromium and Edge get a fresh temporary profile if that browser is already running, and the default profile otherwise.",
425
+ "Profile directory for a new launch (default: MCP_BROWSER_USER_DATA_DIR). Without either, Chromium and Edge use a temporary profile if already running, else the default one.",
408
426
  },
409
427
  waitMs: {
410
428
  type: "integer",
@@ -65,7 +65,7 @@ export function actionTools(server) {
65
65
  definition: {
66
66
  name: "click",
67
67
  description:
68
- "Click a single element located by CSS, text=..., role=..., or name=... syntax. Sends real mouse input at the element center and fails if another element covers that point. A JavaScript alert or confirm dialog that this opens is accepted automatically and a prompt is dismissed; get_events reports it as a dialog event. To check the result in the same call, run it as a run_steps step followed by wait_for, inspect_element, or take_screenshot.",
68
+ "Click an element with real mouse input at its center; fails if another element covers that point. Accepts an alert or confirm dialog it opens and dismisses a prompt (get_events reports it). Check the result in the same call with run_steps.",
69
69
  inputSchema: sessionSchema(
70
70
  {
71
71
  selector: selectorProperty(),
@@ -113,19 +113,19 @@ export function actionTools(server) {
113
113
  definition: {
114
114
  name: "type",
115
115
  description:
116
- "Type text into an input, textarea, or contenteditable element using real text input, replacing existing content unless clear is false. To check the result in the same call, run it as a run_steps step followed by wait_for, inspect_element, or take_screenshot.",
116
+ "Type into an input, textarea, or contenteditable with real text input, replacing its content unless clear is false. Check the result in the same call with run_steps.",
117
117
  inputSchema: sessionSchema(
118
118
  {
119
119
  selector: selectorProperty(),
120
120
  text: {
121
121
  type: "string",
122
122
  description:
123
- "Text to enter. Each newline is sent as an Enter key press: a line break in a textarea, implicit form submission in a single-line input. Date, time, datetime-local, month, week, color, and range inputs get the value set directly, so pass it in that input's value format (for example 2026-09-27). An empty string with clear empties the field.",
123
+ "Text to enter; each newline is an Enter press (a line break in a textarea, form submission in a single-line input). Date, time, datetime-local, month, week, color, and range inputs get the value set directly, in their value format (for example 2026-09-27). An empty string with clear empties the field.",
124
124
  },
125
125
  clear: {
126
126
  type: "boolean",
127
127
  description:
128
- "Replace the existing content (default true). When false, the text is inserted at the end of the current content. Ignored for date, time, datetime-local, month, week, color, and range inputs, whose value is always replaced.",
128
+ "Replace the existing content (default true); false inserts at the end. The picker inputs listed under text are always replaced.",
129
129
  },
130
130
  timeoutMs: actionTimeoutProperty(""),
131
131
  },
@@ -151,7 +151,7 @@ export function actionTools(server) {
151
151
  definition: {
152
152
  name: "select",
153
153
  description:
154
- "Select an option in a native <select> element and fire input and change events. Provide value, label, or both; the first option matching either is selected, and the call fails if none matches. Custom dropdowns built from other elements need click instead. To check the result in the same call, run it as a run_steps step followed by wait_for, inspect_element, or take_screenshot.",
154
+ "Select an option in a native <select> by value or label (the first option matching either) and fire input and change events; fails if none matches. Use click for custom dropdowns. Check the result in the same call with run_steps.",
155
155
  inputSchema: sessionSchema(
156
156
  {
157
157
  selector: selectorProperty(),
@@ -192,7 +192,7 @@ export function actionTools(server) {
192
192
  definition: {
193
193
  name: "press_key",
194
194
  description:
195
- "Press a key or key combination (for example Enter, Tab, Escape, ArrowDown, Shift+Tab, Meta+a) with real keyboard input on the focused element, or on selector after focusing it. Fails if selector cannot take focus. A JavaScript alert or confirm dialog that this opens is accepted automatically and a prompt is dismissed; get_events reports it as a dialog event. To check the result in the same call, run it as a run_steps step followed by wait_for, inspect_element, or take_screenshot.",
195
+ "Press a key or combination with real keyboard input on the focused element, or on selector after focusing it (fails if it cannot take focus). Accepts an alert or confirm dialog it opens and dismisses a prompt (get_events reports it). Check the result in the same call with run_steps.",
196
196
  inputSchema: sessionSchema(
197
197
  {
198
198
  key: {
@@ -51,7 +51,7 @@ export function browserTools(server) {
51
51
  definition: {
52
52
  name: "launch_browser",
53
53
  description:
54
- "Launch a local debug-enabled browser process that matches the current broker configuration and return launch details plus an optional doctor report. When port, address, userDataDir, and unsafeArgs are all omitted and a browser of this family is already reachable, returns it with reused: true instead of launching, opening url in a new tab if given. On macOS and Linux it never starts a second browser on a profile that is already open. Prefer ensure_browser.",
54
+ "Launch a local debug-enabled browser for this server's configuration and return launch details and an optional doctor report. When port, address, userDataDir, and unsafeArgs are omitted and a browser of this family is reachable, returns it with reused: true, opening url in a new tab if given. On macOS and Linux it never opens a second browser on a profile already in use. Prefer ensure_browser.",
55
55
  inputSchema: launchBrowserInputSchema(
56
56
  server.config.browserFamily,
57
57
  server.config.enableUnsafeLaunchArgs,
@@ -110,7 +110,7 @@ export function browserTools(server) {
110
110
  definition: {
111
111
  name: "ensure_browser",
112
112
  description:
113
- "Ensure a compatible browser is reachable through the current broker, reusing a running one when possible. If none answers after three status checks, launch one locally, using the MCP_BROWSER_USER_DATA_DIR profile when set, and optionally open a tab for the requested URL. Will not launch again for 30 seconds while a browser it launched is still starting, and on macOS and Linux never starts a second browser on a profile that is already open.",
113
+ "Reuse a reachable browser or launch one (with the MCP_BROWSER_USER_DATA_DIR profile when set), optionally opening url in a new tab. Checks three times before launching, does not launch again for 30 seconds while a browser it launched is starting, and on macOS and Linux never opens a second browser on a profile already in use.",
114
114
  inputSchema: ensureBrowserInputSchema(
115
115
  server.config.browserFamily,
116
116
  server.config.enableUnsafeLaunchArgs,
@@ -88,7 +88,7 @@ export function inspectionTools(server) {
88
88
  definition: {
89
89
  name: "inspect_element",
90
90
  description:
91
- "Inspect a single DOM element located by CSS, text=..., role=..., or name=... syntax and return normalized element details. Scrolls the element into view first, so the returned box reflects the scrolled position.",
91
+ "Describe one element: its box, visibility, role, accessible name, state, and styles. Scrolls it into view first, so the box reflects the scrolled position.",
92
92
  inputSchema: {
93
93
  type: "object",
94
94
  properties: {
@@ -111,7 +111,7 @@ export function inspectionTools(server) {
111
111
  {
112
112
  definition: {
113
113
  name: "read_text",
114
- description: `Read the visible text of the page's main content (main or role=main, else a single article, else the body), or of one element with selector, as plain lines up to maxChars. With links, also list the links in it with their text and absolute URL, for example to collect search results. Use it to read articles and results pages; inspect_element clips text to 400 characters.`,
114
+ description: `Read the visible text of the main content (main or role=main, else a single article, else the body), or of selector, as plain lines up to maxChars. With links, also list its links with text and absolute URL, for example search results. inspect_element clips text to 400 characters.`,
115
115
  inputSchema: {
116
116
  type: "object",
117
117
  properties: {
@@ -156,7 +156,7 @@ export function inspectionTools(server) {
156
156
  definition: {
157
157
  name: "take_screenshot",
158
158
  description:
159
- "Capture a screenshot from an attached page or a single element when selector is provided. By default the image comes back as base64 data in the JSON result; output image returns it as image content instead, and output file (or path) writes it to a file and returns the path.",
159
+ "Screenshot the page, or one element with selector. Returns base64 data in the JSON by default; output image returns image content instead, and output file (or path) writes a file and returns its path.",
160
160
  inputSchema: {
161
161
  type: "object",
162
162
  properties: {
@@ -175,11 +175,11 @@ export function inspectionTools(server) {
175
175
  type: "string",
176
176
  enum: ["data", "image", "file"],
177
177
  description:
178
- "How to return the image: data puts base64 data in the JSON result, image returns an image content block with only metadata in the JSON, file writes the decoded image to a file and returns its path (default data, or file when path is given).",
178
+ "data (default) puts base64 in the JSON, image returns image content with metadata in the JSON, file writes a file and returns its path (the default when path is given).",
179
179
  },
180
180
  path: {
181
181
  type: "string",
182
- description: `Absolute file path for output file, ending in ${screenshotFileExtensions(server.config.browserFamily).join(", ")}; the extension sets the format. Missing parent directories are created. Default: a new file in a private directory under the system temp directory.`,
182
+ description: `Absolute path for output file, ending in ${screenshotFileExtensions(server.config.browserFamily).join(", ")} (the extension sets the format); parent directories are created. Default: a new file in a private temp directory.`,
183
183
  },
184
184
  overwrite: {
185
185
  type: "boolean",
@@ -267,7 +267,7 @@ export function inspectionTools(server) {
267
267
  returnByValue: {
268
268
  type: "boolean",
269
269
  description:
270
- "Return the result as a JSON value (default true). When false, only a short description of the resulting object is returned. Chromium and Edge only; Firefox always returns a serialized value.",
270
+ "Return a JSON value (default true); false returns a short description of the object. Chromium and Edge only; Firefox always returns a serialized value.",
271
271
  },
272
272
  },
273
273
  required: ["sessionId", "expression"],
@@ -190,8 +190,8 @@ export function stateTools(server) {
190
190
  definition: {
191
191
  name: "wait_for",
192
192
  description: server.config.enableEvaluate
193
- ? "Wait until every given condition holds on an attached session: selector state, selector text (textEquals, textIncludes, textExcludes), exact url, urlIncludes substring, readyState, and a JavaScript expression. Give at least one of selector, url, urlIncludes, readyState, or expression, or give anyOf to wait until any one of several conditions holds. Polls until the conditions match or timeoutMs passes, then fails with the last observed state. A selector check scrolls the matched element into view on each poll."
194
- : "Wait until every given condition holds on an attached session: selector state, selector text (textEquals, textIncludes, textExcludes), exact url, urlIncludes substring, and readyState. Give at least one of selector, url, urlIncludes, or readyState, or give anyOf to wait until any one of several conditions holds. Polls until the conditions match or timeoutMs passes, then fails with the last observed state. A selector check scrolls the matched element into view on each poll.",
193
+ ? "Wait until every given condition holds: selector state, its text (textEquals, textIncludes, textExcludes), url, urlIncludes, readyState, or expression; or give anyOf to end on the first of several. Polls until they hold or timeoutMs passes, then fails with the last observed state. Selector checks scroll the element into view."
194
+ : "Wait until every given condition holds: selector state, its text (textEquals, textIncludes, textExcludes), url, urlIncludes, or readyState; or give anyOf to end on the first of several. Polls until they hold or timeoutMs passes, then fails with the last observed state. Selector checks scroll the element into view.",
195
195
  inputSchema: waitForInputSchema({
196
196
  expression: server.config.enableEvaluate,
197
197
  }),