list_identifiers
Display tracked Python identifiers in your session. Filter by type like functions or variables to organize code elements.
Instructions
List all tracked identifiers in the current session.
Optionally filter by type (function, variable, class, method, constant).
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_identifiers"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type_filter | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp_pyrefly/server.py:344-365 (handler)The MCP tool handler function 'list_identifiers' that processes requests and returns identifier data.
@mcp.tool() async def list_identifiers( type_filter: str | None = None, context: Context | None = None ) -> dict[str, Any]: """ List all tracked identifiers in the current session. Optionally filter by type (function, variable, class, method, constant). """ identifiers = session_tracker.list_identifiers(id_type=type_filter) return { "count": len(identifiers), "identifiers": [ { "name": info.name, "type": info.type, "occurrences": info.occurrences, "first_seen": info.first_seen.isoformat(), "last_seen": info.last_seen.isoformat(), "signatures": info.signatures, "files": list(info.file_locations), - The underlying logic in 'SessionTracker' that retrieves and filters identifiers from the session data.
def list_identifiers(self, id_type: str | None = None) -> list[IdentifierInfo]: """List all tracked identifiers, optionally filtered by type.""" if id_type: return [info for info in self.identifiers.values() if info.type == id_type] return list(self.identifiers.values())