test_tool | MCPサーバーへの接続のテストに用いる UsageこのツールはMCPサーバーへの接続が正常に行われているかを確認するためのツールです。 Key FeaturesFiltering OptionsResult InterpretationWhen to Use |
rename_symbol_by_tsmorph | [Uses ts-morph] Renames TypeScript/JavaScript symbols across the project. Analyzes the AST (Abstract Syntax Tree) to track and update references
throughout the project, not just the definition site.
Useful for cross-file refactoring tasks during Vibe Coding. UsageUse this tool, for example, when you change a function name defined in one file
and want to reflect that change in other files that import and use it.
ts-morph parses the project based on tsconfig.json to resolve symbol references
and perform the rename. - Specify the exact location (file path, line, column) of the symbol
(function name, variable name, class name, etc.) you want to rename.
This is necessary for ts-morph to identify the target Identifier node in the AST.
- Specify the current symbol name and the new symbol name.
- Specify the symbol kind (
function , variable , class ).
This allows additional validation to ensure the node identified by ts-morph
is of the expected type (e.g., an Identifier within a FunctionDeclaration),
preventing unintended renames. - It's recommended to first run with
dryRun: true to check which files
ts-morph will modify. - If the preview looks correct, run with
dryRun: false (or omit it)
to actually save the changes to the file system.
Parameters- tsconfigPath (string, required): Path to the project's root
tsconfig.json file.
Essential for ts-morph to correctly parse the project structure and file references. Must be an absolute path (relative paths can be misinterpreted). - targetFilePath (string, required): Path to the file where the symbol to be renamed
is defined (or first appears). Must be an absolute path (relative paths can be misinterpreted).
- position (object, required): The exact position on the symbol to be renamed.
Serves as the starting point for ts-morph to locate the AST node.
- line (number, required): 1-based line number, typically obtained from an editor.
- column (number, required): 1-based column number (position of the first character
of the symbol name), typically obtained from an editor.
- symbolName (string, required): The current name of the symbol before renaming.
Used to verify against the node name found at the specified position.
- newName (string, required): The new name for the symbol after renaming.
- symbolKind (string, required): The kind of the symbol ("function", "variable", "class", etc.).
Used to verify the type of the target by checking the kind of the parent node
identified by ts-morph (e.g., FunctionDeclaration).
- dryRun (boolean, optional): If set to true, prevents ts-morph from making and saving
file changes, returning only the list of files that would be affected.
Useful for verification. Defaults to false.
Result- On success: Returns a message containing the list of file paths modified
(or scheduled to be modified if dryRun) by the rename.
- On failure: Returns a message indicating the error.
|
rename_filesystem_entry_by_tsmorph | [Uses ts-morph] Renames a single TypeScript/JavaScript file OR FOLDER and updates all import/export paths referencing it throughout the project. Analyzes the project based on tsconfig.json to find all references to the file/folder being renamed and automatically corrects its paths. Includes a remark about potential issues with path aliases and relative index imports. UsageUse this tool when you want to rename a file (e.g., utils.ts -> helpers.ts ) or a folder (e.g., src/data -> src/coreData ) and need all the import statements in other files that point to it to be automatically updated. - Specify the path to the project's
tsconfig.json file. Must be an absolute path. - Specify the current absolute path of the file or folder to rename.
- Specify the new desired absolute path for the file or folder.
- It's recommended to first run with
dryRun: true to check which files will be affected. - If the preview looks correct, run with
dryRun: false (or omit it) to actually save the changes to the file system.
Parameters- tsconfigPath (string, required): Absolute path to the project's root
tsconfig.json file. Essential for ts-morph to parse the project. Must be an absolute path. - oldPath (string, required): The current absolute path of the file or folder to rename. Must be an absolute path.
- newPath (string, required): The new desired absolute path for the file or folder. Must be an absolute path.
- dryRun (boolean, optional): If set to true, prevents ts-morph from making and saving file changes, returning only the list of files that would be affected. Useful for verification. Defaults to false.
Result- On success: Returns a message containing the list of file paths modified (the renamed file/folder and files with updated imports) or scheduled to be modified if dryRun.
- On failure: Returns a message indicating the error.
Remarks (Added)- Caution: Updating import/export statements containing path aliases (like
@/ ) or relative paths referencing a directory's index.ts (like import from '.' ) might be incomplete in the current ts-morph implementation. Manual verification and correction might be necessary after renaming.
|
find_references_by_tsmorph | [Uses ts-morph] Finds the definition and all references to a symbol at a given position throughout the project. Analyzes the project based on tsconfig.json to locate the definition and all usages of the symbol (function, variable, class, etc.) specified by its position. UsageUse this tool before refactoring to understand the impact of changing a specific symbol. It helps identify where a function is called, where a variable is used, etc. - Specify the absolute path to the project's
tsconfig.json . - Specify the absolute path to the file containing the symbol you want to investigate.
- Specify the exact position (line and column) of the symbol within the file.
Parameters- tsconfigPath (string, required): Absolute path to the project's root
tsconfig.json file. Essential for ts-morph to parse the project. Must be an absolute path. - targetFilePath (string, required): The absolute path to the file containing the symbol to find references for. Must be an absolute path.
- position (object, required): The exact position of the symbol to find references for.
- line (number, required): 1-based line number.
- column (number, required): 1-based column number.
Result- On success: Returns a message containing the definition location (if found) and a list of reference locations (file path, line number, column number, and line text).
- On failure: Returns a message indicating the error.
|
remove_path_alias_by_tsmorph | [Uses ts-morph] Replaces path aliases (e.g., '@/') with relative paths in import/export statements within the specified target path. Analyzes the project based on tsconfig.json to resolve aliases and calculate relative paths. UsageUse this tool to convert alias paths like import Button from '@/components/Button' to relative paths like import Button from '../../components/Button' . This can be useful for improving portability or adhering to specific project conventions. - Specify the absolute path to the project
tsconfig.json . - Specify the absolute path to the target file or directory where path aliases should be removed.
- Optionally, run with
dryRun: true to preview the changes without modifying files.
Parameters- tsconfigPath (string, required): Absolute path to the project
tsconfig.json file. Must be an absolute path. - targetPath (string, required): The absolute path to the file or directory to process. Must be an absolute path.
- dryRun (boolean, optional): If true, only show intended changes without modifying files. Defaults to false.
Result- On success: Returns a message containing the list of file paths modified (or scheduled to be modified if dryRun).
- On failure: Returns a message indicating the error.
|