close-browser
Close a specific AdsPower browser profile by providing its user ID, enabling automated browser management through the LocalAPI MCP server.
Instructions
Close the browser
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes | The browser id of the browser to stop, it is required when you want to stop the browser |
Implementation Reference
- src/handlers/browser.ts:49-54 (handler)The handler function closeBrowser that sends an axios GET request to the CLOSE_BROWSER API endpoint with the userId parameter and returns a success message.async closeBrowser({ userId }: CloseBrowserParams) { const response = await axios.get(`${LOCAL_API_BASE}${API_ENDPOINTS.CLOSE_BROWSER}`, { params: { user_id: userId } }); return 'Browser closed successfully'; },
- src/types/schemas.ts:108-110 (schema)Zod schema defining the input for close-browser tool: requires a 'userId' string parameter.closeBrowserSchema: z.object({ userId: z.string().describe('The browser id of the browser to stop, it is required when you want to stop the browser') }).strict(),
- src/utils/toolRegister.ts:14-15 (registration)Registers the 'close-browser' tool on the MCP server using the closeBrowserSchema and wrapped browserHandlers.closeBrowser function.server.tool('close-browser', 'Close the browser', schemas.closeBrowserSchema.shape, wrapHandler(browserHandlers.closeBrowser));