list_profiles
Retrieve a list of all profile IDs captured in the current Scalene profiling session for access and management.
Instructions
List all captured profiles in this session.
Returns: [profile_id, ...]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/scalene_mcp/server.py:433-438 (handler)Main handler function for the 'list_profiles' MCP tool. Returns a list of profile IDs from the in-memory recent_profiles dictionary.
async def list_profiles() -> list[str]: """List all captured profiles in this session. Returns: [profile_id, ...] """ return list(recent_profiles.keys()) - src/scalene_mcp/server.py:441-441 (registration)Registers list_profiles as an MCP tool on the FastMCP server.
server.tool(list_profiles) - src/scalene_mcp/server.py:29-29 (schema)In-memory store for profile results, typed as dict[str, ProfileResult]. The list_profiles tool returns keys from this dict.
recent_profiles: dict[str, ProfileResult] = {} - src/scalene_mcp/storage.py:86-95 (helper)Alternative list_profiles implementation in ProfileStorage class for persistent file-based storage. Uses glob to list .json files.
def list_profiles(self) -> list[str]: """ List all stored profile IDs. Returns: List of profile IDs """ return [ p.stem for p in self.storage_dir.glob("*.json") ]