Skip to content

profile_run

MCP tools › Run, test and tasks

Profile a run configuration from .ferris-idea/run.toml for CPU (default) or memory: before-launch configurations run normally, then the configuration runs once under a profiler (cProfile/tracemalloc for Python, JDK Flight Recorder for Java, sample/leaks on macOS, perf/Massif on Linux; Java memory refused). Dry run by default: returns profiler and command. dry_run=false needs the user-granted run right, runs within the configuration's timeout and returns exit code, duration, the 25 hottest functions by self cost and the call tree pruned to nodes of at least 1 %; nodes carry in_project. Java profiles also have time: total (wall time, waits included), a timeline per thread and, with events: true, the recording's events (GC, sleeps, waits, I/O, threads). Kept in .ferris-idea/profiles/, shown in the Profiler tool window, logged in the agent log.

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

Capabilityexecution.profile_run
AreaRun, test and tasks
Accesschanges processes
Reachesprocess
Rightsrun, trusted-project
Dry rundry_run, on unless the call turns it off

Arguments

ArgumentTypeDescription
namerequiredstringName of the run configuration in .ferris-idea/run.toml.
dry_runbooleanOnly return what would run (default true).
kindstringcpu (default) or memory (SPEC-0250).
only_projectbooleanProject code only (default false).
filestringWorkspace-relative file: add its per-line costs as lines.
timestringcpu (default) or total (Java only).
eventsbooleanAdd the recording's events, at most 500 (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.

Terminal window
ferris-idea call ~/my-project profile_run '{"name":"<string>"}'
Input schema as JSON
{
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"description": "Name of the run configuration in `.ferris-idea/run.toml`.",
"type": "string"
},
"dry_run": {
"description": "Only return what would run (default true).",
"type": [
"boolean",
"null"
]
},
"kind": {
"description": "`cpu` (default) or `memory` (SPEC-0250).",
"type": [
"string",
"null"
]
},
"only_project": {
"description": "Project code only (default false).",
"type": [
"boolean",
"null"
]
},
"file": {
"description": "Workspace-relative file: add its per-line costs as `lines`.",
"type": [
"string",
"null"
]
},
"time": {
"description": "`cpu` (default) or `total` (Java only).",
"type": [
"string",
"null"
]
},
"events": {
"description": "Add the recording's events, at most 500 (default false).",
"type": [
"boolean",
"null"
]
}
}
}