Skip to main content
Glama
webdriverio

WebDriverIO MCP Server

Official

get_mock_calls

Read-only

Retrieve registered mock call arguments to verify intercepted requests, using the same target as the mock; supports browser URL/method and Electron API/function filters.

Instructions

Read current call arguments for a mock in the active session. Use the same target as mock. mockType defaults to browser in WebDriver sessions and is required in Electron sessions. Electron mocks require apiName and funcName; browser mocks require url and accept method. Appium sessions are unsupported.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoRequired for mockType browser: URL glob to intercept, such as **/api/todos.
methodNoOptional for mockType browser: request method filter, such as get.
apiNameNoRequired for mockType electron: API module, such as dialog, app, or clipboard.
funcNameNoRequired for mockType electron: API function, such as showOpenDialog or getName.
mockTypeNoMock type: electron or browser. Defaults to browser in WebDriver sessions; required in Electron sessions. Browser mocks intercept network requests by url glob and require a BiDi-enabled session (start_session with capabilities: { webSocketUrl: true }); in Electron sessions they additionally require the session to have negotiated BiDi. Electron mocks require apiName and funcName. Appium sessions are unsupported.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv3.14.0
    • addedInput schema / properties / method
      Added value: +{
      +  "description": "Optional for mockType browser: request method filter, such as get.",
      +  "type": "string"
      +}
    • changedInput schema / properties / mockType / description
      Previous value: -"Mock type: electron or browser. Defaults to browser in WebDriver sessions; required in Electron sessions. Browser mocking is not implemented yet. Appium sessions are unsupported."New value: +"Mock type: electron or browser. Defaults to browser in WebDriver sessions; required in Electron sessions. Browser mocks intercept network requests by url glob and require a BiDi-enabled session (start_session with capabilities: { webSocketUrl: true }); in Electron sessions they additionally require the session to have negotiated BiDi. Electron mocks require apiName and funcName. Appium sessions are unsupported."
    • addedInput schema / properties / url
      Added value: +{
      +  "description": "Required for mockType browser: URL glob to intercept, such as **/api/todos.",
      +  "minLength": 1,
      +  "type": "string"
      +}
  2. Addedv3.13.0

TDQS

A4.4/5.0
Behavior4/5

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

The readOnlyHint annotation already covers the safe-read profile; the description adds useful behavior: active-session scoping, session-dependent mockType defaults, and unsupported Appium sessions. It does not describe return formatting or failure behavior, but the annotation lowers that burden.

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?

Three dense sentences with no filler. The purpose is front-loaded, and the caveats about target reuse, mockType defaults, and unsupported sessions each earn their place.

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?

The definition handles a fairly complex conditional parameter model (zero required params in schema but conditional requirements by session type) and includes important exclusions. It is missing explicit return-value behavior, especially since there is no output schema, but the core call is well covered.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds conditional semantics beyond the schema by linking mockType to session type and clarifying which parameters apply to electron vs browser mocks. This elevates it above the schema-only 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?

The description opens with a clear verb and resource: 'Read current call arguments for a mock in the active session.' This precisely identifies the operation and scopes it, distinguishing it from related siblings like mock or manage_mock.

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

Usage Guidelines4/5

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

The description gives practical guidance: use the same target as mock, mockType behavior differs by session type, and Appium sessions are explicitly unsupported. It does not name alternative tools, but for a companion read command this is sufficient routing information.

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