Skip to main content
Glama
piekstra

New Relic MCP Server

by piekstra

list_dashboards

Retrieve all dashboards for a specified New Relic account to monitor application performance, track metrics, and analyze system health data.

Instructions

List all dashboards for an account

Input Schema

NameRequiredDescriptionDefault
account_idNo

Input Schema (JSON Schema)

{ "properties": { "account_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Account Id" } }, "type": "object" }

Implementation Reference

  • MCP tool handler function decorated with @mcp.tool(). It calls the NewRelicClient.list_dashboards method and returns the JSON-formatted result or error.
    @mcp.tool() async def list_dashboards(account_id: Optional[str] = None) -> str: """List all dashboards for an account""" if not client: return json.dumps({"error": "New Relic client not initialized"}) try: result = await client.list_dashboards(account_id) return json.dumps(result, indent=2) except Exception as e: return json.dumps({"error": str(e)}, indent=2)
  • Core implementation in NewRelicClient class. Executes NerdGraph GraphQL query to fetch list of dashboards for the given account.
    async def list_dashboards(self, account_id: Optional[str] = None) -> Dict[str, Any]: """List all dashboards for an account""" acc_id = account_id or self.account_id if not acc_id: raise Exception("Account ID is required for dashboard operations") query = """ query($accountId: Int!) { actor { account(id: $accountId) { dashboards { results { guid name description createdAt updatedAt permissions } } } } } """ variables = {"accountId": int(acc_id)} return await self.nerdgraph_query(query, variables)

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