Skip to main content
Glama
santoshray02

CSV Editor

by santoshray02

list_sessions

Display all active CSV editing sessions to manage ongoing data manipulation tasks within the CSV Editor MCP server.

Instructions

List all active sessions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function implementing the list_sessions tool logic. It retrieves the session manager, lists active sessions, and returns formatted session information.
    async def list_sessions(ctx: Context = None) -> Dict[str, Any]:
        """List all active sessions.
        
        Args:
            ctx: FastMCP context
        
        Returns:
            List of active sessions
        """
        try:
            session_manager = get_session_manager()
            sessions = session_manager.list_sessions()
            
            if ctx:
                await ctx.info(f"Found {len(sessions)} active sessions")
            
            return {
                "success": True,
                "message": f"Found {len(sessions)} active sessions",
                "sessions": [s.model_dump() for s in sessions]
            }
            
        except Exception as e:
            if ctx:
                await ctx.error(f"Failed to list sessions: {str(e)}")
            return {
                "success": False,
                "message": "Failed to list sessions",
                "error": str(e)
            }
  • Registration of the 'list_sessions' tool using the @mcp.tool decorator. This thin wrapper delegates to the implementation in io_operations.py.
    @mcp.tool
    async def list_sessions(ctx: Context = None) -> Dict[str, Any]:
        """List all active sessions."""
        return await _list_sessions(ctx)
  • Helper method in SessionManager class that performs the actual listing of active sessions after cleanup, returning SessionInfo objects.
    def list_sessions(self) -> List[SessionInfo]:
        """List all active sessions."""
        self._cleanup_expired()
        return [session.get_info() for session in self.sessions.values() if session.df is not None]
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden for behavioral disclosure. 'List all active sessions' implies a read-only operation, but it doesn't specify what 'active' means, whether it includes metadata like session IDs or durations, if there's pagination for many sessions, or any authentication requirements. This leaves significant gaps for a tool that might return sensitive session data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states the core functionality without any fluff. It's front-loaded and wastes no words, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 0 parameters and an output schema exists, the description doesn't need to explain inputs or return values. However, as a session management tool with no annotations, it should clarify behavioral aspects like what constitutes 'active' or security implications. The output schema will help, but the description alone is minimally adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate here, but it slightly implies scope ('all active') without contradicting the schema, warranting a baseline score above minimum.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('active sessions'), making the purpose immediately understandable. However, it doesn't differentiate from potential siblings like 'get_session_info' or 'close_session' that also involve sessions, so it misses full sibling distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'get_session_info' (which might retrieve details of a specific session) and 'close_session' (which terminates sessions), there's no indication of when listing all active sessions is appropriate versus other session-related operations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/santoshray02/csv-editor'

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