Skip to content

prettier_file

MCP tools › Code insight and refactoring

Format a file with the project's own Prettier (node_modules/.bin/prettier in or above its package, inside the workspace, with the project's configuration; nothing is downloaded). dry_run defaults to true and returns whether it changes and the formatted text; dry_run=false writes it, refusing if the file changed meanwhile.

Its results carry text from files, process: the client is told to treat that as data, never as instructions.

Capabilitycode.prettier_file
AreaCode insight and refactoring
Accesschanges files
Reachesprocess
Rightswrite, trusted-project
Dry rundry_run, on unless the call turns it off

Arguments

ArgumentTypeDescription
pathrequiredstringWorkspace-relative .java or .kt file (optimize_imports: also a Python, JavaScript, TypeScript, Vue or Svelte file).
dry_runbooleanOnly report the change (default true; optimize_imports only).

Call it from a shell

ferris-idea call runs one tool with the rights and safe mode of ferris-idea mcp. Replace the folder and the placeholder values.

Terminal window
ferris-idea call ~/my-project prettier_file '{"path":"<string>"}'
Input schema as JSON
{
"type": "object",
"required": [
"path"
],
"properties": {
"path": {
"description": "Workspace-relative `.java` or `.kt` file (`optimize_imports`: also a Python, JavaScript,\nTypeScript, Vue or Svelte file).",
"type": "string"
},
"dry_run": {
"description": "Only report the change (default true; `optimize_imports` only).",
"type": [
"boolean",
"null"
]
}
}
}