Skip to main content
Glama
dlwjdtn535

mcp-chrome-server

tool_get_elements

Get multiple elements from a webpage using a CSS or XPath selector and return their text content and outer HTML.

Instructions

Get multiple elements matching a selector.

    This tool finds all elements matching the selector and returns their text
    content and HTML.
    
    Args:
        selector (str): The selector to find the elements
        by (str, optional): The selector type. Either "css" or "xpath". Defaults to "css"
    
    Returns:
        Dict[str, Any]: A dictionary containing:
            - success (bool): Whether the operation was successful
            - message (str): Status message
            - data (List[Dict]): List of elements, each containing:
                - text (str): The text content of the element
                - html (str): The outer HTML of the element
    
    Example:
        {"tool": "get_elements", "args": {"selector": ".item"}}
        {"tool": "get_elements", "args": {"selector": "//li[@class='item']", "by": "xpath"}}
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYes
byNocss
Behavior3/5

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

No annotations are provided, so the description carries full burden. It explains the tool returns text and HTML for each element, but does not disclose behavior for edge cases like no matching elements, invalid selectors, or performance implications. The return structure is documented, which is adequate.

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

Conciseness4/5

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

The description is well-structured with Args, Returns, and Example sections. It is relatively concise, though the Args and Returns details could be slightly more compact. Overall, it communicates effectively without unnecessary verbosity.

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 the absence of an output schema, the description adequately documents the return type and structure. It provides a complete overview of inputs and outputs. However, it lacks discussion of error handling or what occurs when no elements are found, which would enhance completeness.

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

Parameters4/5

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

Schema has 0% description coverage, so the description adds significant value. It explains that 'selector' is used to find elements and 'by' specifies the selector type ('css' or 'xpath') with a default of 'css'. Examples further clarify usage. However, it could mention valid values for 'by' more explicitly.

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: 'Get multiple elements matching a selector' and specifies it returns text content and HTML. Among sibling tools like get_text or get_page_source, it is distinct in retrieving multiple elements with both text and HTML.

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 examples but no explicit guidance on when to use this tool versus alternatives (e.g., get_text for single element, get_page_source for full HTML). It does not state when not to use or any prerequisites.

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/dlwjdtn535/mcp-chrome-server'

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