list_servers
Retrieve all servers monitored by New Relic Infrastructure to view and manage your server inventory.
Instructions
List all servers monitored by New Relic Infrastructure
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- newrelic_mcp/server.py:468-479 (handler)MCP tool handler for 'list_servers'. Decorated with @mcp.tool(), calls the NewRelicClient.list_servers() method, handles errors, and returns JSON-formatted results.@mcp.tool() async def list_servers() -> str: """List all servers monitored by New Relic Infrastructure""" if not client: return json.dumps({"error": "New Relic client not initialized"}) try: result = await client.list_servers() return json.dumps(result, indent=2) except Exception as e: return json.dumps({"error": str(e)}, indent=2)
- newrelic_mcp/server.py:136-140 (helper)Helper method in NewRelicClient class that performs the actual HTTP GET request to the New Relic API endpoint for listing servers.async def list_servers(self) -> Dict[str, Any]: """List all servers monitored by New Relic Infrastructure""" url = f"{self.base_url}/servers.json" return await self._make_request("GET", url)