Skip to main content
Glama
aferreiraguido

javascript-mcp-server

analyze_react_component

Analyzes React components to extract typed props, hooks with arguments, consumed contexts, custom hooks, early returns, and memo/forwardRef usage.

Instructions

In-depth analysis of a React component: typed props, hooks with arguments, consumed contexts, custom hooks, early returns and memo/forwardRef. Deterministic (ts-morph).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesRelative path to the component .tsx/.jsx file
nameYesName or path of the loaded project
Behavior3/5

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

The note that the tool is 'Deterministic (ts-morph)' adds useful behavioral context about the static-analysis approach and reproducibility. However, with no annotations, the description does not disclose side effects, prerequisites like needing a loaded project, or input/output side effects, leaving gaps in transparency.

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 a single sentence that efficiently packs the tool's purpose and a list of analysis categories, plus the deterministic note. It has no filler or redundant statements, though the dense list could arguably be structured more clearly.

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?

With no output schema, the description does not explain the return value shape, which is a notable gap for an analysis tool. It does enumerate what is analyzed, suggesting the output likely contains those elements, and the parameters are clear, but prerequisites and result format are left to inference.

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?

Both parameters in the schema are described at 100% coverage: 'Relative path to the component .tsx/.jsx file' and 'Name or path of the loaded project'. The tool description does not add further parameter details, so the baseline of 3 for full schema coverage is appropriate.

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 specifies the tool performs in-depth analysis of a React component and enumerates the exact types of information it extracts (typed props, hooks with arguments, consumed contexts, custom hooks, early returns, memo/forwardRef). It is clear and specific, but it does not explicitly distinguish itself from sibling React analysis tools like analyze_react_state or find_react_memo_opportunities, so it misses the top score.

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 phrase 'in-depth analysis' implies this tool is for comprehensive React component investigation, but there is no explicit guidance about when to use it versus sibling tools such as analyze_react_state or list_react_hooks_deps. It does not list alternatives, exclusions, or prerequisites, making usage guidance only implied.

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/aferreiraguido/javascript-mcp-server'

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