get_user
Retrieve detailed user information from New Relic monitoring platform by providing a user ID to access account data and permissions.
Instructions
Get details for a specific user
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_id | Yes |
Input Schema (JSON Schema)
{
"properties": {
"user_id": {
"title": "User Id",
"type": "string"
}
},
"required": [
"user_id"
],
"type": "object"
}
Implementation Reference
- newrelic_mcp/server.py:632-643 (handler)The main MCP tool handler for 'get_user'. Decorated with @mcp.tool() for automatic registration. Calls the NewRelicClient.get_user method and returns formatted JSON response or error.@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)
- newrelic_mcp/server.py:131-134 (helper)Helper method in NewRelicClient class that performs the actual API request to retrieve user details from New Relic.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)