Skip to main content
Glama

get_document_state

Retrieve current Chrome page state including URL, title, readyState, selection, and scroll position using Chrome DevTools Protocol for efficient page orientation.

Instructions

Return current Chrome page state via CDP: url, title, readyState, selection, and scroll position. Far cheaper than browser_get_dom for page orientation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portNoCDP port (default 9222).
tabIdNoCDP tab id (omit for first page).
Behavior4/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 effectively describes key traits: it's a read operation ('return'), uses Chrome DevTools Protocol ('via CDP'), and has performance characteristics ('far cheaper'). However, it doesn't mention potential failures (e.g., if CDP isn't connected), rate limits, or authentication needs, leaving some gaps for a tool interacting with browser state.

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

Conciseness5/5

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

The description is highly concise and front-loaded: two sentences with zero waste. The first sentence states the core purpose and output, while the second provides critical usage guidance. Every word earns its place, making it efficient for an agent to parse.

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

Completeness4/5

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

Given no annotations, no output schema, and 2 parameters with full schema coverage, the description is mostly complete. It covers purpose, output data, and usage vs alternatives. However, as a tool interacting with browser state via CDP, it lacks details on error conditions, response format, or prerequisites (e.g., requiring an active CDP connection), which could hinder agent reliability.

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?

Schema description coverage is 100%, so the schema fully documents both parameters (port and tabId). The description adds no additional parameter semantics beyond what's in the schema, such as explaining when tabId is needed or CDP connection details. Baseline 3 is appropriate since the schema does the heavy lifting.

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

Purpose5/5

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

The description clearly states the tool's purpose with specific verbs ('return current Chrome page state') and resources ('via CDP'), listing exact data returned (url, title, readyState, selection, scroll position). It explicitly distinguishes from sibling 'browser_get_dom' by noting it's 'far cheaper for page orientation,' providing clear differentiation.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool vs alternatives: 'far cheaper than browser_get_dom for page orientation.' This directly tells the agent to prefer this tool for lightweight page state retrieval over the more expensive DOM extraction tool, offering clear context for selection.

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/Harusame64/desktop-touch-mcp'

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