Skip to main content
Glama

scan_components

Read-only

Scan local project files for reusable UI components, identifying React, Vue, and Svelte components via AST signatures and returning their names and props.

Instructions

Scan the local project for existing UI components so they can be reused instead of regenerated. Runs on the server filesystem, not in Figma. Identifies components by AST signature (exported, PascalCase, function-ish) rather than by folder layout, so any structure works. React (.tsx/.jsx) is parsed for name + props; Vue/Svelte derive the name from the file and parse props from the block (defineProps / export let / $props). extensions defaults to the detected profile's; rootDir defaults to the server cwd. Returns { components, profile }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rootDirNoProject root to scan; defaults to the server cwd
extensionsNoComponent file extensions to scan; defaults to the detected profile
Behavior5/5

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

Annotations already declare readOnlyHint=true, and the description adds substantial behavioral detail beyond that: AST-based identification (exported, PascalCase, function-ish), independence from folder layout, framework-specific parsing for React/Vue/Svelte, default behaviors for extensions and rootDir, and the exact return shape. This transparently sets expectations for the operation.

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?

The description is compact but information-dense, leading with the core purpose before explaining detection logic, framework handling, and defaults. Each sentence contributes novel information, though the framework-specific parsing details (React vs Vue/Svelte) make it slightly longer than necessary for a quick scan. Still, it is well-structured and free of filler.

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?

With no output schema, the description compensates by explicitly stating the return value ('Returns { components, profile }'). It covers the operation's location, detection method, framework support, parameter defaults, and return shape. Given the tool's moderate complexity and the absence of an output schema, the description is fully complete for an agent to select and invoke it correctly.

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 description coverage is 100% for both parameters, so the baseline is 3. The description adds minimal new semantic value; it only repeats the default behavior for 'extensions' and 'rootDir' that the schema already documents. It does not explain parameter syntax or edge cases beyond what the schema provides, so no score above baseline is warranted.

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 'scan' and a clear resource ('local project for existing UI components') with an explicit purpose ('so they can be reused instead of regenerated'). It also distinguishes itself from Figma-based siblings by stating 'Runs on the server filesystem, not in Figma', making it clear this is a local filesystem operation rather than a Figma document scan.

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

Usage Guidelines4/5

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

The description conveys when to use the tool: when you need to discover existing local UI components for reuse. It also clarifies the scope ('Runs on the server filesystem, not in Figma'), which helps an agent choose this over Figma scanning tools. However, it does not explicitly name alternatives or provide 'when not to use' guidance, so it falls short of a 5.

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/awdr74100/figwright'

If you have feedback or need assistance with the MCP directory API, please join our Discord server