Skip to main content
Glama
dlwjdtn535

mcp-chrome-server

tool_get_text

Finds an element by CSS or XPath selector and returns its text content. Use for extracting visible text from web page elements.

Instructions

Get text from an element.

    This tool finds an element and returns its text content.
    
    Args:
        selector (str): The selector to find the element
        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 (str): The text content of the element
    
    Example:
        {"tool": "get_text", "args": {"selector": "h1"}}
        {"tool": "get_text", "args": {"selector": "//div[@class='content']", "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 must carry the burden. It explains the return value structure but does not cover error behavior, such as what happens if the element is not found. The tool appears non-destructive but missing error-handling details reduces transparency.

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 concise and well-structured: a one-line summary, followed by Args, Returns, and examples. Every sentence is necessary and adds value, with no fluff.

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?

For a simple tool with two parameters and no output schema, the description is fairly complete. It explains the purpose, parameters, and return format. However, it could clarify that it returns text from the first matching element, but that is implicitly clear from the examples.

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 description coverage is 0%, but the description compensates by providing a brief description for each parameter, including type, possible values for 'by', and default. This adds meaning beyond the schema's property titles.

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 text from an element.' It specifies the action (get) and resource (text from an element), and differentiates from sibling tools like tool_get_elements by focusing on text content.

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

Usage Guidelines3/5

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

The description provides examples and parameter descriptions but lacks explicit guidance on when to use this tool vs alternatives. It does not mention when not to use it or differentiate from other retrieval tools like tool_get_page_source.

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