file_type
MCP tools › Workspace and files
File types of the workspace: which language a file is treated as and why, and the associations in .ferris-idea/file-types.toml. get returns language (LSP id or null), title, source and matching pattern; list returns patterns, overrides and choosable languages. override/revert set or clear one file's language; associate/dissociate a name pattern's. Precedence: override, pattern (exact before wildcard, longer first), name and extension, modeline, hashbang. Changing actions are dry run by default (reporting before and after); dry_run=false needs the write right, is logged and takes effect at once.
| Capability | workspace.file_type |
|---|---|
| Area | Workspace and files |
| Access | changes files |
| Reaches | — |
| Rights | write |
| Dry run | dry_run, on unless the call turns it off |
Arguments
| Argument | Type | Description |
|---|---|---|
action | string | get (default), list, override, revert, associate or dissociate. |
path | string | Workspace-relative path of the file (get, override, revert). |
pattern | string | File name pattern with * and ? (associate, dissociate), e.g. *.tpl. |
language | string | LSP id of the language, or text for plain text (override, associate). |
dry_run | boolean | Only 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.
ferris-idea call ~/my-project file_typeInput schema as JSON
{ "type": "object", "properties": { "action": { "description": "`get` (default), `list`, `override`, `revert`, `associate` or `dissociate`.", "type": [ "string", "null" ] }, "path": { "description": "Workspace-relative path of the file (`get`, `override`, `revert`).", "type": [ "string", "null" ] }, "pattern": { "description": "File name pattern with `*` and `?` (`associate`, `dissociate`), e.g. `*.tpl`.", "type": [ "string", "null" ] }, "language": { "description": "LSP id of the language, or `text` for plain text (`override`, `associate`).", "type": [ "string", "null" ] }, "dry_run": { "description": "Only report what would change (default true); false changes and needs the `write` right.", "type": [ "boolean", "null" ] } }}