Skip to content

file_properties

MCP tools › Workspace and files

Encoding, line separator and read-only state of a workspace text file. get returns them with counts, size and editor state. set_line_separator, convert_encoding (safety same, reversible or lossy; lossy refused unless lossy true, writing ?), reload_encoding (reads in that encoding until Ferris IDEA quits, writes nothing) and set_read_only are dry runs unless dry_run false, which needs the write right and is logged. Writes go through a temp file and rename, keeping permissions. Refused: paths outside the workspace, non-text or >20 MiB files, read-only files, and unsaved editor changes for the encoding and read-only actions.

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

Capabilityworkspace.file_properties
AreaWorkspace and files
Accesschanges files
Reaches—
Rightswrite
Dry rundry_run, on unless the call turns it off

Arguments

ArgumentTypeDescription
pathrequiredstringWorkspace-relative path of the file.
actionstringget (default), set_line_separator, convert_encoding, reload_encoding or set_read_only.
line_separatorstringFor set_line_separator: lf, crlf or cr.
encodingstringFor the encoding actions: UTF-8, UTF-16LE, UTF-16BE, ISO-8859-1, windows-1252 or US-ASCII.
bombooleanFor convert_encoding to UTF-8: whether the file starts with a byte order mark (default: as it is now when the file is UTF-8, else none).
lossybooleanFor convert_encoding: true confirms a conversion that loses characters; each one the encoding cannot hold is written as ?. Default false: such a conversion is refused.
read_onlybooleanFor set_read_only: the wanted state.
dry_runbooleanOnly report what would change (default true); false changes and needs the write right.

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 file_properties '{"path":"<string>"}'
Input schema as JSON
{
"type": "object",
"required": [
"path"
],
"properties": {
"path": {
"description": "Workspace-relative path of the file.",
"type": "string"
},
"action": {
"description": "`get` (default), `set_line_separator`, `convert_encoding`, `reload_encoding` or\n`set_read_only`.",
"type": [
"string",
"null"
]
},
"line_separator": {
"description": "For `set_line_separator`: `lf`, `crlf` or `cr`.",
"type": [
"string",
"null"
]
},
"encoding": {
"description": "For the encoding actions: `UTF-8`, `UTF-16LE`, `UTF-16BE`, `ISO-8859-1`, `windows-1252`\nor `US-ASCII`.",
"type": [
"string",
"null"
]
},
"bom": {
"description": "For `convert_encoding` to UTF-8: whether the file starts with a byte order mark (default:\nas it is now when the file is UTF-8, else none).",
"type": [
"boolean",
"null"
]
},
"lossy": {
"description": "For `convert_encoding`: true confirms a conversion that loses characters; each one the\nencoding cannot hold is written as `?`. Default false: such a conversion is refused.",
"type": [
"boolean",
"null"
]
},
"read_only": {
"description": "For `set_read_only`: the wanted state.",
"type": [
"boolean",
"null"
]
},
"dry_run": {
"description": "Only report what would change (default true); false changes and needs the `write` right.",
"type": [
"boolean",
"null"
]
}
}
}