Skip to main content
Glama

Find the source file for a selector

find_source
Read-onlyIdempotent

Locate source files in a local project that contain a given CSS selector. Map DOM selectors back to React, Vue, Svelte, HTML, PHP, or Astro code so you can edit the right file.

Instructions

Find source files in the local project that contain a given CSS selector. Maps DOM selectors back to source code so you can edit the right file. Searches React/Vue/Svelte/HTML/PHP/Astro files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rootDirNoProject root to search (defaults to cwd)
selectorYesCSS selector from a scan issue

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.1

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so safety and idempotency are covered. The description adds file-type coverage (React/Vue/Svelte/HTML/PHP/Astro) but does not disclose return format, false-positive behavior, or performance characteristics. With annotations covering the safety profile, a 3 is appropriate.

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?

Three sentences, each with a purpose: action, rationale, and file-type scope. No wasted words and the core use case is front-loaded. Could be slightly tighter but is well-structured.

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 read-only lookup tool with full schema coverage and no output schema, the description provides enough context: what it does, why (edit the right file), and supported file types. Missing return format details, but those are minor for a read-only tool.

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%, so the schema fully documents both parameters (selector and rootDir). The description reinforces 'given CSS selector' but adds no syntax or format details beyond the schema. Baseline 3 is correct when the schema does the heavy lifting.

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?

Clear verb ('Find') and resource ('source files') with a specific scope: files containing a given CSS selector. Distinguishes from siblings like scan_page or get_audit, but does not explicitly name an alternative tool for related tasks.

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 implies when to use it: mapping a DOM selector from a scan issue back to code. No explicit when-not-to-use or alternative tools are mentioned, so usage is only implied.

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