Skip to main content
Glama
piekstra

New Relic MCP Server

by piekstra

get_user

Retrieve specific user details from New Relic monitoring data by providing a user ID for access control and management purposes.

Instructions

Get details for a specific user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYes

Implementation Reference

  • The main MCP tool handler for the 'get_user' tool. It checks if the client is initialized, calls the client's get_user method with the provided user_id, and returns the result as formatted JSON or an error message.
    @mcp.tool() async def get_user(user_id: str) -> str: """Get details for a specific user""" if not client: return json.dumps({"error": "New Relic client not initialized"}) try: result = await client.get_user(user_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 performs the actual HTTP GET request to the New Relic API endpoint for retrieving specific user details.
    async def get_user(self, user_id: str) -> Dict[str, Any]: """Get details for a specific user""" url = f"{self.base_url}/users/{user_id}.json" return await self._make_request("GET", url)
  • The @mcp.tool() decorator registers the get_user function as an MCP tool with the name 'get_user'.
    @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