python_profile
Profile Python scripts using cProfile, py-spy, or memray to identify performance bottlenecks.
Instructions
Profile Python code performance using cProfile, py-spy, or memray
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"command": "<command>"
},
"name": "python_profile"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | Additional arguments | |
| topN | No | Show top N functions (default: 20) | |
| format | No | Output format (default: text) | |
| command | Yes | Python script to profile | |
| timeout | No | Command timeout in milliseconds | |
| profiler | No | Profiler to use (default: cprofile) | |
| directory | No | Working directory | |
| outputFile | No | Save profile to file |