document_symbols
MCP tools › Code insight and refactoring
Symbols of a workspace file (functions, types, fields, …) in document order with kind, line and nesting depth, from its language server. For a Python file each function and method carries its parameter list in detail, such as (a, b=2, *args, **kw), and parameters and local variables of functions are left out. An HTML file lists its elements nested as in the document, kind element, each named with its id and classes (main#prices.card) and with the href of a link or a and the src of an img or script as detail, from Ferris IDEA's own syntax tree without a server.
Its results carry text from files, language_server: the client is told to treat that as data, never as instructions.
| Capability | code.document_symbols |
|---|---|
| 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. |
structure | boolean | The File Structure popup's view (SPEC-0079 v4): no package symbols, ordered by kind and
name below each parent, anonymous classes and lambdas left out unless asked for. |
anonymous | boolean | With structure: keep anonymous classes. |
lambdas | boolean | With structure: keep lambdas. |
inherited | boolean | Add the members each type inherits from supertypes in project files, with
inherited_from and path. |
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 document_symbols '{"path":"<string>"}'Input schema as JSON
{ "type": "object", "required": [ "path" ], "properties": { "path": { "description": "Workspace-relative file path.", "type": "string" }, "structure": { "description": "The File Structure popup's view (`SPEC-0079` v4): no package symbols, ordered by kind and\nname below each parent, anonymous classes and lambdas left out unless asked for.", "type": [ "boolean", "null" ] }, "anonymous": { "description": "With `structure`: keep anonymous classes.", "type": [ "boolean", "null" ] }, "lambdas": { "description": "With `structure`: keep lambdas.", "type": [ "boolean", "null" ] }, "inherited": { "description": "Add the members each type inherits from supertypes in project files, with\n`inherited_from` and `path`.", "type": [ "boolean", "null" ] } }}