Skip to main content
Glama

Get Element CSS Selectors

elementor_get_element_selector
Read-onlyIdempotent

Get an Elementor element's CSS selectors and find all matching rules in WordPress Additional CSS and compiled CSS to see which styles apply.

Instructions

Get the CSS selectors for an element (.elementor-element-{id} for outer, > .elementor-widget-container for widgets) and find all matching CSS rules from both WordPress Additional CSS and Elementor compiled CSS. Essential for understanding what CSS actually applies to an element.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "postId": "<postId>",
      "elementId": "<elementId>"
    },
    "name": "elementor_get_element_selector"
  }
}

Input Schema

NameRequiredDescriptionDefault
postIdYesWordPress post/page ID
elementIdYesElementor element ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.0.0

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so safety is covered. The description adds real value by disclosing the two CSS sources it searches (WordPress Additional CSS and Elementor compiled CSS), but it says nothing about result volume, ordering, or how matches are structured.

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?

Two sentences, front-loaded with the action and the selector formats, then the source scope. Dense but every clause carries information; the parenthetical selector examples are the only slightly heavy part.

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 two-parameter read-only lookup, the description conveys what is fetched, from which CSS stores, and why it matters. The main residual gap is the shape of the returned matches, which is not described and no output schema exists to compensate.

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 coverage is 100% and both parameters are already documented as postId (WordPress post/page ID) and elementId (Elementor element ID). The description adds only indirect context via the '{id}' selector pattern, which hints at the elementId format but does not explicitly link it to the parameter.

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?

Names a specific verb+resource ('Get the CSS selectors for an element') and explains the exact output content (matching CSS rules from WordPress Additional CSS and Elementor compiled CSS). It distinguishes itself from CSS-reading siblings implicitly by combining both sources, though it never names them.

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 closing line ('Essential for understanding what CSS actually applies to an element') implies a debugging/CSS-troubleshooting context, but there is no explicit when-to-use versus elementor_get_compiled_css or elementor_get_page_css, and no prerequisites or exclusions.

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