list_synthetic_monitors
Retrieve all synthetic monitors configured in New Relic to view and manage automated performance tests for websites and applications.
Instructions
List all synthetic monitors
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- newrelic_mcp/server.py:403-414 (handler)MCP tool handler function decorated with @mcp.tool(). It checks if the client is initialized, calls the client's list_synthetic_monitors method, and returns the JSON-formatted result or error.@mcp.tool() async def list_synthetic_monitors() -> str: """List all synthetic monitors""" if not client: return json.dumps({"error": "New Relic client not initialized"}) try: result = await client.list_synthetic_monitors() return json.dumps(result, indent=2) except Exception as e: return json.dumps({"error": str(e)}, indent=2)
- newrelic_mcp/server.py:116-119 (helper)Helper method in NewRelicClient class that makes an HTTP GET request to the New Relic Synthetics API endpoint to retrieve the list of synthetic monitors.async def list_synthetic_monitors(self) -> Dict[str, Any]: """List all synthetic monitors""" return await self._make_request("GET", f"{self.synthetics_url}/monitors.json")