Skip to main content
Glama

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).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
type_filterNo

Implementation Reference

  • 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())

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kimasplund/mcp-pyrefly'

If you have feedback or need assistance with the MCP directory API, please join our Discord server