Skip to main content
Glama
blackwhite084

Playwright Server MCP

playwright_navigate

Navigate web pages by providing a URL, automatically creating a browser session for web automation tasks.

Instructions

Navigate to a URL,thip op will auto create a session

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes

Implementation Reference

  • Core handler implementation for playwright_navigate. Automatically creates a browser session if none exists, navigates to the provided URL (adding https:// if needed), fetches page text content, and returns a confirmation with a text preview.
    class NavigateToolHandler(ToolHandler):
        async def handle(self, name: str, arguments: dict | None) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]:
            if not self._sessions:
                await NewSessionToolHandler().handle("",{})
                # return [types.TextContent(type="text", text="No active session. Please create a new session first.")]
            session_id = list(self._sessions.keys())[-1]
            page = self._sessions[session_id]["page"]
            url = arguments.get("url")
            if not url.startswith("http://") and not url.startswith("https://"):
                url = "https://" + url
            await page.goto(url)
            text_content=await GetTextContentToolHandler().handle("",{})
            return [types.TextContent(type="text", text=f"Navigated to {url}\npage_text_content[:200]:\n\n{text_content[:200]}")]
  • JSON Schema definition for the playwright_navigate tool, specifying required 'url' parameter as string. Defined within the list_tools handler.
    types.Tool(
        name="playwright_navigate",
        description="Navigate to a URL,thip op will auto create a session",
        inputSchema={
            "type": "object",
            "properties": {
                "url": {"type": "string"}
            },
            "required": ["url"]
        }
    ),
  • Registration of all tool handlers in a dictionary, mapping 'playwright_navigate' to an instance of NavigateToolHandler. This dict is used by the @server.call_tool() dispatcher.
    tool_handlers = {
        "playwright_navigate": NavigateToolHandler(),
        "playwright_screenshot": ScreenshotToolHandler(),
        "playwright_click": ClickToolHandler(),
        "playwright_fill": FillToolHandler(),
        "playwright_evaluate": EvaluateToolHandler(),
        "playwright_click_text": ClickTextToolHandler(),
        "playwright_get_text_content": GetTextContentToolHandler(),
        "playwright_get_html_content": GetHtmlContentToolHandler(),
        "playwright_new_session":NewSessionToolHandler(),
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions automatic session creation, which is useful context about initialization behavior. However, it lacks details on error handling (e.g., invalid URLs), navigation timeouts, or whether it waits for page load—critical for a navigation tool. The description adds some value but is incomplete for behavioral transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief but contains a typo ('thip op' instead of 'this operation'), which reduces clarity. It's front-loaded with the main action but could be more structured. The single sentence is efficient but could be improved for readability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (navigation with session management), no annotations, no output schema, and low schema coverage, the description is insufficient. It misses key details like return values (e.g., success status), error conditions, or interaction with sibling tools. The automatic session creation hint is helpful but doesn't provide complete context for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 1 parameter (url) with 0% description coverage, so the schema provides no semantic details. The description doesn't add any parameter-specific information beyond implying a URL is needed. Since there's only one parameter, the baseline is higher, but the description doesn't compensate for the lack of schema coverage with details like URL format or validation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Navigate to a URL') and resource (a URL), making the purpose understandable. However, it doesn't explicitly differentiate this navigation tool from sibling tools like playwright_click or playwright_fill, which perform different browser interactions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides minimal guidance with 'thip op will auto create a session' (likely meaning 'this operation will automatically create a session'), suggesting it handles session initialization. However, it doesn't specify when to use this tool versus alternatives like direct URL input in other tools or mention prerequisites like needing a browser context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/blackwhite084/playwright-plus-python-mcp'

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