Skip to main content
Glama
webdriverio

WebDriverIO MCP Server

Official
by webdriverio

get_mock_calls

Read-only

Get the current call arguments for a mock in the active session to verify mocked interactions. For Electron mocks, provide apiName and funcName; browser mocks are not yet supported.

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 mocking is not implemented yet; Appium sessions are unsupported.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
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 mocking is not implemented yet. Appium sessions are unsupported.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv3.13.0

TDQS

A4.1/5.0
Behavior4/5

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

The readOnlyHint annotation already signals a safe read operation, and the description adds valuable behavioral constraints: active session scope, mockType default behavior, Electron-specific parameter requirements, and unsupported browser/Appium cases. It does not contradict the annotation and gives enough detail to set expectations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded in the first sentence, followed by concise usage and limitation notes. Some details repeat the schema descriptions, but the description remains compact and scannable.

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?

Given that this is a read-only inspection tool with well-documented parameters, the description covers target selection, defaults, required conditions, and unsupported sessions. It does not specify the exact return shape, but the return behavior is implied clearly by the stated purpose.

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

Parameters3/5

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

Schema description coverage is 100%, and the schema already documents that apiName and funcName are required for electron and that mockType has defaults and limitations. The description reinforces these points but does not add significant meaning beyond the schema.

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 states a specific action, 'Read current call arguments for a mock', tied to a clear resource and scope ('in the active session'). This clearly differentiates it from sibling tools like mock and manage_mock, which create or modify mocks rather than inspect them.

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 clear practical guidance: use the same target as mock, understand that mockType defaults to browser in WebDriver and is required in Electron, and that Electron mocks need apiName and funcName. It also states unsupported contexts. It does not explicitly name alternatives, but the context is sufficient for correct use.

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