navigate
Direct a browser to a specific URL using this tool, enabling precise navigation to desired web pages through AdsPower LocalAPI MCP Server.
Instructions
Navigate to the url
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The url to navigate to |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"url": {
"description": "The url to navigate to",
"type": "string"
}
},
"required": [
"url"
],
"type": "object"
}
Implementation Reference
- src/handlers/automation.ts:23-27 (handler)The main handler function for the 'navigate' tool. It checks if the browser is connected, navigates the current page to the provided URL using Puppeteer, and returns a success message.async navigate({ url }: NavigateParams) { browser.checkConnected(); await browser.pageInstance!.goto(url); return `Navigated to ${url} successfully`; },
- src/types/schemas.ts:173-175 (schema)Zod schema defining the input parameters for the navigate tool: an object with a required 'url' string field.navigateSchema: z.object({ url: z.string().describe('The url to navigate to') }).strict(),
- src/utils/toolRegister.ts:56-57 (registration)Registers the 'navigate' tool with the MCP server, specifying the name, description, input schema, and wrapped handler function.server.tool('navigate', 'Navigate to the url', schemas.navigateSchema.shape, wrapHandler(automationHandlers.navigate));
- src/types/browser.ts:13-13 (schema)TypeScript type definition for NavigateParams, inferred from the navigateSchema for type safety in the handler.export type NavigateParams = z.infer<typeof schemas.navigateSchema>;