get_server
Retrieve detailed information about a specific server from New Relic monitoring data to analyze performance and troubleshoot issues.
Instructions
Get details for a specific server
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| server_id | Yes |
Implementation Reference
- newrelic_mcp/server.py:481-492 (handler)MCP tool handler for 'get_server'. This is the main function decorated with @mcp.tool() that handles the tool execution, calls the NewRelicClient.get_server method, and returns the result as JSON.@mcp.tool() async def get_server(server_id: str) -> str: """Get details for a specific server""" if not client: return json.dumps({"error": "New Relic client not initialized"}) try: result = await client.get_server(server_id) return json.dumps(result, indent=2) except Exception as e: return json.dumps({"error": str(e)}, indent=2)
- newrelic_mcp/server.py:141-144 (helper)Helper method in NewRelicClient class that makes the actual HTTP request to the New Relic API to fetch server details by ID.async def get_server(self, server_id: str) -> Dict[str, Any]: """Get details for a specific server""" url = f"{self.base_url}/servers/{server_id}.json" return await self._make_request("GET", url)
- newrelic_mcp/server.py:481-481 (registration)The @mcp.tool() decorator registers the get_server function as an MCP tool.@mcp.tool()