Skip to main content
Glama
piekstra

New Relic MCP Server

by piekstra

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
NameRequiredDescriptionDefault
server_idYes

Implementation Reference

  • 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)
  • 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)
  • The @mcp.tool() decorator registers the get_server function as an MCP tool.
    @mcp.tool()

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