find_usages
MCP tools › Code insight and refactoring
Find Usages for the symbol at a position of a workspace file (saved content): declaration and usages grouped by file (path, line, character, line text) from the language server within timeout_s; when slower or no server is installed, whole-word text occurrences in files of the same extension, marked source: text with a note why. CSS class and id selectors add HTML uses from Ferris IDEA's own index (source: own_index). in_file true is Find Usages in File. Each usage has a kind (import, call, write, read, type, declaration, other, Go extras, comment); count counts code usages, comment_count comment mentions. The symbol's own declaration is never listed.
Its results carry text from files, language_server: the client is told to treat that as data, never as instructions.
| Capability | code.find_usages |
|---|---|
| Area | Code insight and refactoring |
| Access | reads only |
| Reaches | process |
| Rights | none |
| Dry run | none |
Arguments
| Argument | Type | Description |
|---|---|---|
pathrequired | string | Workspace-relative file path. |
linerequired | integer | 0-based line.minimum 0 |
characterrequired | integer | 0-based character in the line (Unicode scalar values).minimum 0 |
timeout_s | integer | Seconds the search may take, 1–60 (default 20); after that the text occurrences are given.minimum 0 |
in_file | boolean | Only the usages in the file of the position, as Find Usages in File (SPEC-0293 v7
behaviour 19); default false. |
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 find_usages '{"path":"<string>","line":1,"character":1}'Input schema as JSON
{ "type": "object", "required": [ "path", "line", "character" ], "properties": { "path": { "description": "Workspace-relative file path.", "type": "string" }, "line": { "description": "0-based line.", "type": "integer", "minimum": 0 }, "character": { "description": "0-based character in the line (Unicode scalar values).", "type": "integer", "minimum": 0 }, "timeout_s": { "description": "Seconds the search may take, 1–60 (default 20); after that the text occurrences are given.", "type": [ "integer", "null" ], "minimum": 0 }, "in_file": { "description": "Only the usages in the file of the position, as Find Usages in File (`SPEC-0293` v7\nbehaviour 19); default false.", "type": [ "boolean", "null" ] } }}