Skip to main content
Glama
Yan-Vi
by Yan-Vi

set_scope

Add or replace a page-object scope using a Playwright locator, so nested locators only need uniqueness within that root.

Instructions

Add or replace a SCOPE on a page object -- a root-element locator other locators on the same page object can be nested under (see set_method_scope), so their own selectors only need to be unique within it instead of the whole page. Useful for a reusable section (a modal, a repeated table row) -- a page object already models either a full page or a section; scopes are what make the section case actually robust. scope is stored as a bare camelCase name (auto-sanitized, e.g. "results") -- "Scope" is appended only in generated code (e.g. resultsScope), not part of the stored name. selector is a Playwright locator-chain expression, same format as set_locator's own (e.g. "locator('.results')") -- a ${paramName} block inside one of its string-literal arguments makes it parametric, for a scope reused per row/instance -- rare in practice, most scopes are static.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scopeYes
projectNoPath to the project root (same folder the side panel connects to). Defaults to the EASYSPEC_PROJECT environment variable if omitted.
selectorYes
pageObjectYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.4

TDQS

C2.9/5.0
Behavior3/5

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

No annotations are present, so the description carries the full burden. It states 'Add or replace', which indicates a mutation and potential overwrite, but does not mention side effects, permissions, or failure modes.

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

Conciseness2/5

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

The description is excessively long and repetitive, repeating 'root-element locator' and 'reusable section' concepts. It could be trimmed significantly without losing clarity.

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

Completeness3/5

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

The description provides sufficient context for the purpose of scopes, but lacks information about the return value, error handling, and prerequisites (e.g., whether the page object must exist). It is adequate but not complete.

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?

The schema description covers only 'project' (25% coverage). The description adds meaningful context for 'scope' and 'selector' (naming and format), but 'pageObject' remains unexplained. Partial value is added beyond the schema.

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?

The description clearly states the verb 'Add or replace' and the resource 'SCOPE on a page object', and references a sibling tool (set_method_scope) for distinction. However, it is verbose and could be more direct.

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 implies usage for reusable sections but does not explicitly state when to use this tool versus alternatives like set_locator or set_method_scope. No clear when-to-use or when-not-to-use guidance is provided.

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