Skip to main content
Glama

Get Content

get_content
Read-onlyIdempotent

Need content from a page element? Extract its visible text, HTML, or normalized URLs using a CSS or XPath selector.

Instructions

Get visible text, HTML, or discovered URLs from the selected element.

Args: selector: CSS selector or SeleniumBase-supported XPath selector. Default: "body".

output_format:
    - "text": Return visible text from the selected element.
    - "html": Return HTML from the selected element.
    - "urls": Return URLs discovered by SeleniumBase within the
      selected element. Returned URLs are normalized to full URLs
      with their protocol prefixes.

timeout: Maximum seconds to wait for the target element. Default: 5.

Tool selection: - Need URL, title, origin, or User-Agent -> use get_page_info. - Need visible text, html, or URLs on a page -> use get_content. - Need structured information about matching elements -> use find_elements. - Need to check element presence/visibility -> use check_if_condition. - Need to wait for content to appear -> use wait_for_condition.

If there's no matching element found within the timeout, then @handle_sb_errors returns details from the exception raised.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timeoutNo
selectorNobody
output_formatNotext

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv4.54.2
    • removedInput schema / properties / include_shadow_dom
      Removed value: -{
      -  "default": true,
      -  "title": "Include Shadow Dom",
      -  "type": "boolean"
      -}
    • removedInput schema / properties / selector / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • changedInput schema / properties / selector / default
      Previous value: -nullNew value: +"body"
    • addedInput schema / properties / selector / type
      Added value: +"string"
    • addedInput schema / properties / timeout
      Added value: +{
      +  "default": 5,
      +  "title": "Timeout",
      +  "type": "number"
      +}
  2. Addedv4.53.3

TDQS

A5/5.0
Behavior5/5

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

Annotations already indicate read-only, idempotent, and non-destructive behavior, and the description adds meaningful behavioral details: it returns only visible text, normalizes discovered URLs to full URLs with protocol prefixes, and explains the timeout and error-handling path. There is no contradiction with annotations.

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 detailed yet tightly structured: purpose first, then parameters, then routing guidance, then error behavior. Every section earns its place and no sentences are wasted. The tool-selection list is slightly repetitive but adds practical value.

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

Completeness5/5

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

Given the simple three-parameter surface, the description covers inputs, defaults, output format semantics, sibling-tool routing, and failure behavior. An output schema exists, so the exact return shape does not need to be described. Nothing important is missing for an agent to invoke it correctly.

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

Parameters5/5

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

Schema description coverage is 0%, but the description fully compensates. It explains each parameter, including what 'selector' accepts (CSS or SeleniumBase-supported XPath), the meaning of every output_format enum value, default behavior, and timeout semantics in seconds.

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 opens with a specific verb and resource: 'Get visible text, HTML, or discovered URLs from the selected element.' It clearly enumerates the output formats and differentiates from sibling tools via the tool-selection section, so an agent knows exactly what this tool produces.

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 'Tool selection' section explicitly tells the agent when to use get_content versus get_page_info, find_elements, check_if_condition, and wait_for_condition. It also documents the default 'body' selector and error behavior if no element matches, leaving little to inference.

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