Skip to main content
Glama
AdsPower

AdsPower LocalAPI MCP Server

Official

close-browser

Stop a specific browser instance in AdsPower by providing its unique user ID using the LocalAPI MCP Server. Simplify browser management and resource optimization.

Instructions

Close the browser

Input Schema

NameRequiredDescriptionDefault
userIdYesThe browser id of the browser to stop, it is required when you want to stop the browser

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "userId": { "description": "The browser id of the browser to stop, it is required when you want to stop the browser", "type": "string" } }, "required": [ "userId" ], "type": "object" }

Implementation Reference

  • The core handler function for the 'close-browser' tool. It makes an axios GET request to the local API endpoint to close the browser associated with the given userId 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'; },
  • Zod schema for validating the input parameters of the 'close-browser' tool, requiring a 'userId' string.
    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(),
  • Registration of the 'close-browser' tool on the MCP server, including name, description, schema, and wrapped handler.
    server.tool('close-browser', 'Close the browser', schemas.closeBrowserSchema.shape, wrapHandler(browserHandlers.closeBrowser));

Latest Blog Posts

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/AdsPower/local-api-mcp-typescript'

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