Skip to content

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.

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

Arguments

ArgumentTypeDescription
actionstringget (default), list, override, revert, associate or dissociate.
pathstringWorkspace-relative path of the file (get, override, revert).
patternstringFile name pattern with * and ? (associate, dissociate), e.g. *.tpl.
languagestringLSP id of the language, or text for plain text (override, associate).
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_type
Input 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"
]
}
}
}