Skip to content

Commit 4906b38

Browse files
committed
docs: Update tooling description to reflect usability
1 parent ecc4b2a commit 4906b38

9 files changed

Lines changed: 13 additions & 13 deletions

File tree

src/tools/click.tool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const defaultTimeout: number = 3000;
99

1010
export const clickToolDefinition: ToolDefinition = {
1111
name: 'click_element',
12-
description: 'clicks an element',
12+
description: 'Waits for an element to exist, scrolls it into view, and calls element.click(). For browser sessions. On iOS, element.click() is sometimes ignored — use tap_element (which calls element.tap()) instead.',
1313
inputSchema: {
1414
selector: z.string().describe('Value for the selector, in the form of css selector or xpath ("button.my-class" or "//button[@class=\'my-class\']" or "button=Exact text with spaces" or "a*=Link containing text")'),
1515
scrollToView: coerceBoolean.optional().describe('Whether to scroll the element into view before clicking').default(true),

src/tools/context.tool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { getBrowser } from '../session/state';
66

77
export const switchContextToolDefinition: ToolDefinition = {
88
name: 'switch_context',
9-
description: 'switches between native and webview contexts',
9+
description: 'Switches between native and webview automation contexts in a hybrid mobile app. Required before using CSS/XPath selectors inside an embedded webview — switch to WEBVIEW_* first, then switch back to NATIVE_APP for native elements. List available contexts from wdio://session/current/contexts.',
1010
inputSchema: {
1111
context: z
1212
.string()

src/tools/cookies.tool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { coerceBoolean } from '../utils/zod-helpers';
77

88
export const setCookieToolDefinition: ToolDefinition = {
99
name: 'set_cookie',
10-
description: 'sets a cookie with specified name, value, and optional attributes',
10+
description: 'Sets a browser cookie for the active session. The browser must already be on the target domain — cookies cannot be set cross-domain. Use to inject session tokens or feature flags without going through login flows.',
1111
inputSchema: {
1212
name: z.string().describe('Cookie name'),
1313
value: z.string().describe('Cookie value'),

src/tools/device.tool.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ import { getBrowser } from '../session/state';
66

77
export const hideKeyboardToolDefinition: ToolDefinition = {
88
name: 'hide_keyboard',
9-
description: 'hides the on-screen keyboard',
9+
description: 'Dismisses the software keyboard on mobile. Call after text entry when the keyboard obscures elements you need to interact with next. No-op if already hidden. Mobile-only.',
1010
inputSchema: {},
1111
};
1212

1313
export const rotateDeviceToolDefinition: ToolDefinition = {
1414
name: 'rotate_device',
15-
description: 'rotates device to portrait or landscape orientation',
15+
description: 'Rotates a mobile device to portrait or landscape and waits for the OS rotation to complete. Use to test orientation-dependent layouts. Mobile-only; no effect in browser sessions.',
1616
inputSchema: {
1717
orientation: z.enum(['PORTRAIT', 'LANDSCAPE']).describe('Device orientation'),
1818
},
1919
};
2020

2121
export const setGeolocationToolDefinition: ToolDefinition = {
2222
name: 'set_geolocation',
23-
description: 'sets device geolocation (latitude, longitude, altitude)',
23+
description: 'Overrides the device GPS coordinates for the session. Affects navigator.geolocation on web and location services on mobile. Location permissions must be granted to the app before calling this.',
2424
inputSchema: {
2525
latitude: z.number().min(-90).max(90).describe('Latitude coordinate'),
2626
longitude: z.number().min(-180).max(180).describe('Longitude coordinate'),

src/tools/gestures.tool.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { getBrowser } from '../session/state';
77
// Tap Tool
88
export const tapElementToolDefinition: ToolDefinition = {
99
name: 'tap_element',
10-
description: 'taps an element by selector or screen coordinates (mobile)',
10+
description: 'Calls element.tap() on a matched element or taps at absolute screen coordinates. Use on iOS when element.click() (click_element) is ignored — tap is the native gesture iOS responds to. Mobile-only.',
1111
inputSchema: {
1212
selector: z
1313
.string()
@@ -61,7 +61,7 @@ export const tapElementTool: ToolCallback = async (args: {
6161
// Swipe Tool
6262
export const swipeToolDefinition: ToolDefinition = {
6363
name: 'swipe',
64-
description: 'performs a swipe gesture in specified direction (mobile)',
64+
description: 'Performs a full-screen swipe gesture on mobile. Direction is content movement (e.g. "up" scrolls a list upward, not the finger direction). Use to scroll past visible bounds; for moving a specific element use drag_and_drop. Mobile-only — use scroll for browsers.',
6565
inputSchema: {
6666
direction: z.enum(['up', 'down', 'left', 'right']).describe('Swipe direction'),
6767
duration: z

src/tools/navigate.tool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { ToolDefinition } from '../types/tool';
66

77
export const navigateToolDefinition: ToolDefinition = {
88
name: 'navigate',
9-
description: 'navigates to a URL',
9+
description: 'Loads a URL in the current tab and waits for the page load event. Resets page state (DOM, JS runtime). Use instead of clicking links to go directly to a known URL.',
1010
inputSchema: {
1111
url: z.string().min(1).describe('The URL to navigate to'),
1212
},

src/tools/session.tool.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const automationEnum = z.enum(['XCUITest', 'UiAutomator2']);
1515

1616
export const startSessionToolDefinition: ToolDefinition = {
1717
name: 'start_session',
18-
description: 'Starts a browser or mobile app session. For local browser, use browser platform. For mobile apps, use ios or android platform. Use attach mode to connect to an existing Chrome instance.',
18+
description: 'Starts a new browser or mobile automation session. Only one active session at a time — starting a new one closes the existing one. Use platform "browser" with a browser name, or "ios"/"android" with a deviceName. Use attach mode to connect to an already-running Chrome instance via CDP.',
1919
inputSchema: {
2020
provider: z.enum(['local', 'browserstack']).optional().default('local').describe('Session provider (default: local)'),
2121
platform: platformEnum.describe('Session platform type'),
@@ -94,7 +94,7 @@ type StartSessionArgs = {
9494

9595
export const closeSessionToolDefinition: ToolDefinition = {
9696
name: 'close_session',
97-
description: 'Closes or detaches from the current browser or app session',
97+
description: 'Closes or detaches from the current session. Detach disconnects without terminating the process, preserving app state on the Appium server. Sessions started with noReset: true auto-detach by default.',
9898
inputSchema: {
9999
detach: coerceBoolean.optional().describe('If true, disconnect without terminating (preserves app state). Default: false'),
100100
},

src/tools/set-value.tool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const defaultTimeout: number = 3000;
99

1010
export const setValueToolDefinition: ToolDefinition = {
1111
name: 'set_value',
12-
description: 'set value to an element, aka typing',
12+
description: 'Clears an input or textarea and types the given text. Always replaces existing content. Fails if the element is not found or not interactable within the timeout.',
1313
inputSchema: {
1414
selector: z.string().describe('Value for the selector, in the form of css selector or xpath ("button.my-class" or "//button[@class=\'my-class\']")'),
1515
value: z.string().describe('Text to enter into the element'),

src/tools/tabs.tool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { getBrowser } from '../session/state';
66

77
export const switchTabToolDefinition: ToolDefinition = {
88
name: 'switch_tab',
9-
description: 'switches to a browser tab by handle or index',
9+
description: 'Focuses a browser tab by window handle or 0-based index. All subsequent tool calls operate on the newly active tab. Get handles from wdio://session/current/tabs. Browser-only — use switch_context for mobile webviews.',
1010
inputSchema: {
1111
handle: z.string().optional().describe('Window handle to switch to'),
1212
index: z.number().int().min(0).optional().describe('0-based tab index to switch to'),

0 commit comments

Comments
 (0)