file_operations
Manage Unity project files by reading, writing, listing, and searching their contents. Supports scripts, shaders, configs, and more.
Instructions
Read, write, list, and search files within the Unity project.
Actions:
read: Read the contents of a file (scripts, shaders, configs, etc.)
write: Write/create a file in the project (auto-imports to AssetDatabase)
list: List files in a directory with optional pattern filtering
exists: Check if a file or directory exists
search: Search file contents for a text query (grep-like)
get_script_classes: Analyze a C# script to get its classes, methods, and fields
Paths can be absolute or relative to the project root. Examples:
"Assets/Scripts/MyScript.cs" (relative)
"Assets/Shaders/" (directory)
"ProjectSettings/ProjectSettings.asset" (project settings)
Security: All paths must be within the Unity project directory.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | File or directory path (relative to project root or absolute). Examples: "Assets/Scripts/MyScript.cs", "Assets/" | |
| query | No | Search text for search action | |
| action | Yes | File operation to perform | |
| content | No | File content to write (required for write action) | |
| pattern | No | File name pattern for list action (e.g., "*.cs", "*.shader"). Default: "*.*" | |
| extension | No | File extension filter for search action (e.g., ".cs", ".shader"). Default: ".cs" | |
| recursive | No | Recurse into subdirectories for list action. Default: false |