get-opened-browser
Retrieve a list of currently opened browsers to manage and monitor active browser sessions effectively through AdsPower LocalAPI MCP Server integration.
Instructions
Get the list of opened browsers
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
}
Implementation Reference
- src/handlers/browser.ts:119-126 (handler)The main handler function for the 'get-opened-browser' tool. It fetches the list of opened browsers from the local API endpoint and returns a formatted JSON string or throws an error.async getOpenedBrowser() { const response = await axios.get(`${LOCAL_API_BASE}${API_ENDPOINTS.GET_OPENED_BROWSER}`); if (response.data.code === 0) { return `Opened browser list: ${JSON.stringify(response.data.data.list, null, 2)}`; } throw new Error(`Failed to get opened browsers: ${response.data.msg}`); },
- src/utils/toolRegister.ts:29-30 (registration)Registers the 'get-opened-browser' tool with the MCP server, specifying its name, description, input schema, and wrapped handler.server.tool('get-opened-browser', 'Get the list of opened browsers', schemas.emptySchema.shape, wrapHandler(browserHandlers.getOpenedBrowser));
- src/types/schemas.ts:164-164 (schema)The empty input schema (no parameters required) used by the 'get-opened-browser' tool.emptySchema: z.object({}).strict(),