Skip to main content
Glama

pool_stats

View statistics for persistent SSH connection pools to monitor active sessions, usage patterns, and connection health within the SFTP orchestration system.

Instructions

Affiche les statistiques du pool de connexions SSH persistantes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'pool_stats': calls ssh.getPoolStats() and returns formatted statistics as text content.
    async () => { const stats = ssh.getPoolStats(); return { content: [{ type: "text", text: `Pool de connexions SSH:\n${JSON.stringify(stats, null, 2)}` }] }; }
  • Tool specification including title, description, and empty input schema (z.object({})).
    { title: "Statistiques du pool de connexions SSH", description: "Affiche les statistiques du pool de connexions SSH persistantes.", inputSchema: z.object({}) },
  • server.js:617-628 (registration)
    Registration of the 'pool_stats' MCP tool, including schema and inline handler.
    server.registerTool( "pool_stats", { title: "Statistiques du pool de connexions SSH", description: "Affiche les statistiques du pool de connexions SSH persistantes.", inputSchema: z.object({}) }, async () => { const stats = ssh.getPoolStats(); return { content: [{ type: "text", text: `Pool de connexions SSH:\n${JSON.stringify(stats, null, 2)}` }] }; } );
  • Helper function getPoolStats() exported from ssh.js, acting as a wrapper to sshPool.getStats().
    // Obtenir les stats du pool function getPoolStats() { return sshPool.getStats(); }
  • Core implementation of getStats() in SSHConnectionPool class, computing detailed statistics on connections by server.
    // Obtenir les statistiques du pool getStats() { const stats = { totalConnections: this.activeConnections.size, byServer: {} }; for (const [serverAlias, pool] of this.pools) { const connections = pool.map(connId => { const info = this.activeConnections.get(connId); return { id: connId, inUse: info?.inUse || false, ready: info?.conn?.isReady || false, lastUsed: info?.lastUsed }; }); stats.byServer[serverAlias] = { total: connections.length, inUse: connections.filter(c => c.inUse).length, available: connections.filter(c => !c.inUse && c.ready).length, connections }; } return stats; }

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/fkom13/mcp-sftp-orchestrator'

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