Skip to main content
Glama

WDIO MCP Server

by siri100
close.browser.tool.ts897 B
import { z } from 'zod'; import { getBrowserInstance } from './open.browser.tool.js'; // No arguments needed to close the browser export const closeBrowserArguments = z.object({}); // Tool implementation export const closeBrowserTool = async ( _args: z.infer<typeof closeBrowserArguments>, _extra?: any ): Promise<{ content: { type: 'text'; text: string; _meta?: Record<string, unknown>; }[]; }> => { try { const browser = getBrowserInstance(); await browser.deleteSession(); // properly close the WebDriver session return { content: [ { type: 'text', text: `🛑 Browser session closed successfully.`, }, ], }; } catch (e) { return { content: [ { type: 'text', text: `❌ Failed to close browser. Error: ${e?.message || String(e)}`, }, ], }; } };

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/siri100/wdio-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server