get_server
Retrieve detailed information about a specific server from New Relic's infrastructure monitoring platform using the server ID.
Instructions
Get details for a specific server
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| server_id | Yes |
Input Schema (JSON Schema)
{
"properties": {
"server_id": {
"title": "Server Id",
"type": "string"
}
},
"required": [
"server_id"
],
"type": "object"
}
Implementation Reference
- newrelic_mcp/server.py:481-492 (handler)The main handler function for the 'get_server' MCP tool. It checks if the client is initialized, calls the client's get_server method with the provided server_id, and returns the result as formatted JSON or an error message.@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 the NewRelicClient class that constructs the API URL for retrieving server details and makes the HTTP GET request using the client's _make_request method.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)