[README Update] [AOP][Improved server metadata discovery]

pull/1188/head
Kye Gomez 4 days ago
parent b51bc2093b
commit 8f170f4463

@ -7,43 +7,22 @@
<em>The Enterprise-Grade Production-Ready Multi-Agent Orchestration Framework </em>
</p>
<p align="center">
<a href="https://pypi.org/project/swarms/" target="_blank">
<picture>
<source srcset="https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54" media="(prefers-color-scheme: dark)">
<img alt="Python" src="https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54" />
</picture>
<picture>
<source srcset="https://img.shields.io/pypi/v/swarms?style=for-the-badge&color=3670A0" media="(prefers-color-scheme: dark)">
<img alt="Version" src="https://img.shields.io/pypi/v/swarms?style=for-the-badge&color=3670A0">
</picture>
</a>
<!-- Main Navigation Links -->
<a href="https://swarms.ai">🏠 Swarms Website</a>
<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
<a href="https://docs.swarms.world">📙 Documentation</a>
<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
<a href="https://swarms.world">🛒 Swarms Marketplace</a>
</p>
<p align="center">
<!-- Project Stats - Most Important First -->
<a href="https://github.com/kyegomez/swarms/stargazers">
<picture>
<source srcset="https://img.shields.io/github/stars/kyegomez/swarms?style=for-the-badge" media="(prefers-color-scheme: dark)">
<img src="https://img.shields.io/github/stars/kyegomez/swarms?style=for-the-badge" alt="GitHub stars">
</picture>
</a>
<a href="https://github.com/kyegomez/swarms/network">
<picture>
<source srcset="https://img.shields.io/github/forks/kyegomez/swarms?style=for-the-badge" media="(prefers-color-scheme: dark)">
<img src="https://img.shields.io/github/forks/kyegomez/swarms?style=for-the-badge" alt="GitHub forks">
</picture>
</a>
<a href="https://github.com/kyegomez/swarms/issues">
<picture>
<source srcset="https://img.shields.io/github/issues/kyegomez/swarms?style=for-the-badge" media="(prefers-color-scheme: dark)">
<img src="https://img.shields.io/github/issues/kyegomez/swarms?style=for-the-badge" alt="GitHub issues">
</picture>
</a>
<a href="https://github.com/kyegomez/swarms/blob/main/LICENSE">
<a href="https://pypi.org/project/swarms/" target="_blank">
<picture>
<source srcset="https://img.shields.io/github/license/kyegomez/swarms?style=for-the-badge" media="(prefers-color-scheme: dark)">
<img src="https://img.shields.io/github/license/kyegomez/swarms?style=for-the-badge" alt="GitHub license">
<source srcset="https://img.shields.io/pypi/v/swarms?style=for-the-badge&color=3670A0" media="(prefers-color-scheme: dark)">
<img alt="Version" src="https://img.shields.io/pypi/v/swarms?style=for-the-badge&color=3670A0">
</picture>
</a>
<a href="https://pepy.tech/project/swarms">
@ -52,16 +31,6 @@
<img src="https://static.pepy.tech/badge/swarms/month" alt="Downloads">
</picture>
</a>
<a href="https://libraries.io/github/kyegomez/swarms">
<picture>
<source srcset="https://img.shields.io/librariesio/github/kyegomez/swarms?style=for-the-badge" media="(prefers-color-scheme: dark)">
<img src="https://img.shields.io/librariesio/github/kyegomez/swarms?style=for-the-badge" alt="Dependency Status">
</picture>
</a>
</p>
<p align="center">
<!-- Social Media -->
<a href="https://twitter.com/swarms_corp/">
<picture>
<source srcset="https://img.shields.io/badge/Twitter-Follow-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white" media="(prefers-color-scheme: dark)">
@ -74,49 +43,6 @@
<img src="https://img.shields.io/badge/Discord-Join-5865F2?style=for-the-badge&logo=discord&logoColor=white" alt="Discord">
</picture>
</a>
<a href="https://www.youtube.com/@kyegomez3242">
<picture>
<source srcset="https://img.shields.io/badge/YouTube-Subscribe-red?style=for-the-badge&logo=youtube&logoColor=white" media="(prefers-color-scheme: dark)">
<img src="https://img.shields.io/badge/YouTube-Subscribe-red?style=for-the-badge&logo=youtube&logoColor=white" alt="YouTube">
</picture>
</a>
<a href="https://www.linkedin.com/in/kye-g-38759a207/">
<picture>
<source srcset="https://img.shields.io/badge/LinkedIn-Connect-blue?style=for-the-badge&logo=linkedin&logoColor=white" media="(prefers-color-scheme: dark)">
<img src="https://img.shields.io/badge/LinkedIn-Connect-blue?style=for-the-badge&logo=linkedin&logoColor=white" alt="LinkedIn">
</picture>
</a>
<a href="https://x.com/swarms_corp">
<picture>
<source srcset="https://img.shields.io/badge/X.com-Follow-1DA1F2?style=for-the-badge&logo=x&logoColor=white" media="(prefers-color-scheme: dark)">
<img src="https://img.shields.io/badge/X.com-Follow-1DA1F2?style=for-the-badge&logo=x&logoColor=white" alt="X.com">
</picture>
</a>
</p>
<p align="center">
<!-- Main Navigation Links -->
<a href="https://swarms.ai">🏠 Swarms Website</a>
<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
<a href="https://docs.swarms.world">📙 Documentation</a>
<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
<a href="https://swarms.world">🛒 Swarms Marketplace</a>
</p>
<p align="center">
<!-- Share Buttons -->
<a href="https://twitter.com/intent/tweet?text=Check%20out%20this%20amazing%20AI%20project:%20&url=https%3A%2F%2Fgithub.com%2Fkyegomez%2Fswarms">
<picture>
<source srcset="https://img.shields.io/badge/Share%20on%20Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white" media="(prefers-color-scheme: dark)">
<img src="https://img.shields.io/badge/Share%20on%20Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white" alt="Share on Twitter">
</picture>
</a>
<a href="https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fgithub.com%2Fkyegomez%2Fswarms&title=&summary=&source=">
<picture>
<source srcset="https://img.shields.io/badge/Share%20on%20LinkedIn-blue?style=for-the-badge" media="(prefers-color-scheme: dark)">
<img src="https://img.shields.io/badge/Share%20on%20LinkedIn-blue?style=for-the-badge" alt="Share on LinkedIn">
</picture>
</a>
</p>
## ✨ Features

@ -199,9 +199,14 @@ Run the MCP server (alias for start_server).
##### get_server_info()
Get information about the MCP server and registered tools.
**Returns:** `Dict[str, Any]` - Server information
Get comprehensive information about the MCP server and registered tools, including metadata, configuration, tool details, queue stats, and network status.
**Returns:** `Dict[str, Any]` - Server information including:
- Server metadata (name, description, creation time, uptime)
- Configuration (host, port, transport, log level)
- Agent information (total count, names, detailed tool info)
- Queue configuration and statistics (if queue enabled)
- Persistence and network status
##### _register_tool()

@ -659,6 +659,9 @@ class AOP:
self._last_network_error = None
self._network_connected = True
# Server creation timestamp
self._created_at = time.time()
self.agents: Dict[str, Agent] = {}
self.tool_configs: Dict[str, AgentToolConfig] = {}
self.task_queues: Dict[str, TaskQueue] = {}
@ -1980,6 +1983,53 @@ class AOP:
"matching_agents": [],
}
@self.mcp_server.tool(
name="get_server_info",
description="Get comprehensive server information including metadata, configuration, tool details, queue stats, and network status.",
)
def get_server_info_tool() -> Dict[str, Any]:
"""
Get comprehensive information about the MCP server and registered tools.
Returns:
Dict containing server information with the following fields:
- server_name: Name of the server
- description: Server description
- total_tools/total_agents: Total number of agents registered
- tools/agent_names: List of all agent names
- created_at: Unix timestamp when server was created
- created_at_iso: ISO formatted creation time
- uptime_seconds: Server uptime in seconds
- host: Server host address
- port: Server port number
- transport: Transport protocol used
- log_level: Logging level
- queue_enabled: Whether queue system is enabled
- persistence_enabled: Whether persistence mode is enabled
- network_monitoring_enabled: Whether network monitoring is enabled
- persistence: Detailed persistence status
- network: Detailed network status
- tool_details: Detailed information about each agent tool
- queue_config: Queue configuration (if queue enabled)
- queue_stats: Queue statistics for each agent (if queue enabled)
"""
try:
server_info = self.get_server_info()
return {
"success": True,
"server_info": server_info,
}
except Exception as e:
error_msg = str(e)
logger.error(
f"Error in get_server_info tool: {error_msg}"
)
return {
"success": False,
"error": error_msg,
"server_info": None,
}
def _register_queue_management_tools(self) -> None:
"""
Register queue management tools for the MCP server.
@ -2699,18 +2749,30 @@ class AOP:
Get information about the MCP server and registered tools.
Returns:
Dict containing server information
Dict containing server information including metadata, configuration,
and tool details
"""
info = {
"server_name": self.server_name,
"description": self.description,
"total_tools": len(self.agents),
"total_agents": len(self.agents), # Alias for compatibility
"tools": self.list_agents(),
"agent_names": self.list_agents(), # Alias for compatibility
"created_at": self._created_at,
"created_at_iso": time.strftime(
"%Y-%m-%d %H:%M:%S", time.localtime(self._created_at)
),
"uptime_seconds": time.time() - self._created_at,
"verbose": self.verbose,
"traceback_enabled": self.traceback_enabled,
"log_level": self.log_level,
"transport": self.transport,
"host": self.host,
"port": self.port,
"queue_enabled": self.queue_enabled,
"persistence_enabled": self._persistence_enabled, # Top-level for compatibility
"network_monitoring_enabled": self.network_monitoring, # Top-level for compatibility
"persistence": self.get_persistence_status(),
"network": self.get_network_status(),
"tool_details": {

Loading…
Cancel
Save