Skip to main content
Glama
piekstra

New Relic MCP Server

by piekstra

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

NameRequiredDescriptionDefault
server_idYes

Input Schema (JSON Schema)

{ "properties": { "server_id": { "title": "Server Id", "type": "string" } }, "required": [ "server_id" ], "type": "object" }

Implementation Reference

  • 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)
  • 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)

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/piekstra/newrelic-mcp-server'

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