Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to New Relic

Scalekit connector
Open markdown

The New Relic connector lets your AI agent act in each user's New Relic account. Each user connects their own New Relic API key once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 29 tools.

Tools
29
What they doRead · write · destructive
13 · 12 · 413 read12 write4 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the New Relic connection

    In AgentKit > Connections, create a New Relic connection. The name you give it is the connection_name your code passes. See Configure connections.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'newrelic'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize New Relic:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'newrelic_accounts_list',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their New Relic credentials there. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • newrelic_accounts_listList the New Relic accounts the API key's user can access, plus that user's own profile.Read-only

    List Accounts

    List the New Relic accounts the API key's user can access, plus that user's own profile. Returns each account's numeric id and name, and the current user's id, name and email. Use this first to find the account_id that the NRQL, alert, dashboard and synthetics tools need. NerdGraph answers HTTP 200 even when the operation fails, so check the errors array in the response.

    Inputs

    This tool takes no inputs.

  • newrelic_alert_issues_listList alert issues (groups of related incidents) in a New Relic account, filtered by state, priority, entity or time window.Read-only

    List Alert Issues

    List alert issues (groups of related incidents) in a New Relic account, filtered by state, priority, entity or time window. Returns a nextCursor for paging and each issue's issueId, title, description, priority, state, created/activated/closed/acknowledged times, acknowledgedBy, affected entity GUIDs and names, conditionName, policyName, totalIncidents and deepLinkUrl. Use this to see what is alerting now or what fired in a time range. Use newrelic_alert_issue_acknowledge or newrelic_alert_issue_resolve to act on an issue. Requires an account_id from newrelic_accounts_list. Without a time window New Relic returns the last 24 hours. NerdGraph answers HTTP 200 even when the operation fails, so check the errors array in the response.

    Inputs

    account_idintegerrequired
    Numeric New Relic account ID that owns the data. Get it from newrelic_accounts_list, or from the account picker in New Relic. Example: 1234567
    cursorstring
    Pagination cursor. Pass the nextCursor value from the previous response to get the next page; leave empty for the first page. Example: Mjox
    end_timeinteger
    End of the time window, in Unix epoch milliseconds. Set it together with start_time. Example: 1767312000000
    entity_guidsarray
    Return only issues that affect these entities. Get GUIDs from newrelic_entities_search. Example: ["MXxBUE18QVBQTElDQVRJT058MTIzNDU2Nzg"]
    issue_idsarray
    Return only these issues. Example: ["f0846f5e-fc9d-4dc0-afdd-07cce7cc6fc4"]
    priorityarray
    Return only issues with these priorities: LOW, MEDIUM, HIGH or CRITICAL. Example: ["CRITICAL", "HIGH"]
    start_timeinteger
    Start of the time window, in Unix epoch milliseconds. Set it together with end_time; if either is missing New Relic uses the last 24 hours. Example: 1767225600000
    statesarray
    Return only issues in these states: CREATED, ACTIVATED (open), DEACTIVATED or CLOSED. Example: ["ACTIVATED"]
  • newrelic_alert_nrql_condition_getGet one NRQL alert condition by ID.Read-only

    Get NRQL Alert Condition

    Get one NRQL alert condition by ID. Returns its name, enabled flag, policyId, type, NRQL query, thresholds, description, runbookUrl, titleTemplate, signal settings (aggregation window, method, delay, fill option) and loss-of-signal expiration settings. Use this to read a condition's full configuration before changing it. Use newrelic_alert_nrql_conditions_list to find condition IDs. Requires a condition ID from newrelic_alert_nrql_conditions_list. NerdGraph answers HTTP 200 even when the operation fails, so check the errors array in the response.

    Inputs

    account_idintegerrequired
    Numeric New Relic account ID that owns the data. Get it from newrelic_accounts_list, or from the account picker in New Relic. Example: 1234567
    condition_idstringrequired
    ID of the alert condition. Get it from newrelic_alert_nrql_conditions_list. Example: 34567890
  • newrelic_alert_nrql_conditions_listList NRQL alert conditions in a New Relic account, optionally filtered by policy, name or query text.Read-only

    List NRQL Alert Conditions

    List NRQL alert conditions in a New Relic account, optionally filtered by policy, name or query text. Returns totalCount, a nextCursor for paging, and each condition's id, name, enabled flag, policyId, type (STATIC, BASELINE or OUTLIER), NRQL query, thresholds, description and runbookUrl. Use this to find conditions or see what a policy alerts on. Use newrelic_alert_nrql_condition_get for one condition's full signal and expiration settings. Requires an account_id from newrelic_accounts_list. NerdGraph answers HTTP 200 even when the operation fails, so check the errors array in the response.

    Inputs

    account_idintegerrequired
    Numeric New Relic account ID that owns the data. Get it from newrelic_accounts_list, or from the account picker in New Relic. Example: 1234567
    cursorstring
    Pagination cursor. Pass the nextCursor value from the previous response to get the next page; leave empty for the first page. Example: Mjox
    name_likestring
    Return only conditions whose name contains this text. Example: error rate
    policy_idstring
    Return only conditions in this alert policy. Get the ID from newrelic_alert_policies_list. Example: 4567890
    query_likestring
    Return only conditions whose NRQL query contains this text. Example: FROM Transaction
  • newrelic_alert_policies_listList alert policies in a New Relic account, optionally filtered by name.Read-only

    List Alert Policies

    List alert policies in a New Relic account, optionally filtered by name. Returns totalCount, a nextCursor for paging, and each policy's id, name, incidentPreference, accountId and entityGuid. Use this to find a policy ID. Use newrelic_alert_policy_get for one policy and newrelic_alert_nrql_conditions_list for the conditions in a policy. Requires an account_id from newrelic_accounts_list. NerdGraph answers HTTP 200 even when the operation fails, so check the errors array in the response.

    Inputs

    account_idintegerrequired
    Numeric New Relic account ID that owns the data. Get it from newrelic_accounts_list, or from the account picker in New Relic. Example: 1234567
    cursorstring
    Pagination cursor. Pass the nextCursor value from the previous response to get the next page; leave empty for the first page. Example: Mjox
    name_likestring
    Return only policies whose name contains this text (case-insensitive). Example: checkout
  • newrelic_alert_policy_getGet one New Relic alert policy by ID.Read-only

    Get Alert Policy

    Get one New Relic alert policy by ID. Returns the policy's id, name, incidentPreference, accountId and entityGuid. Use this for one policy you have the ID of. Use newrelic_alert_policies_list to search by name. Requires a policy ID from newrelic_alert_policies_list. NerdGraph answers HTTP 200 even when the operation fails, so check the errors array in the response.

    Inputs

    account_idintegerrequired
    Numeric New Relic account ID that owns the data. Get it from newrelic_accounts_list, or from the account picker in New Relic. Example: 1234567
    policy_idstringrequired
    ID of the alert policy. Get it from newrelic_alert_policies_list. Example: 4567890
  • newrelic_dashboard_getGet one New Relic dashboard with its pages and widgets.Read-only

    Get Dashboard

    Get one New Relic dashboard with its pages and widgets. Returns the name, description, permissions, owner, permalink, created/updated times, and every page with its widgets (id, title, visualization id, layout and rawConfiguration, which holds the widget's NRQL queries). Use this to read what a dashboard shows or to copy its NRQL queries into newrelic_nrql_query. Use newrelic_dashboards_list to find dashboard GUIDs. Requires a dashboard GUID from newrelic_dashboards_list. NerdGraph answers HTTP 200 even when the operation fails, so check the errors array in the response.

    Inputs

    guidstringrequired
    GUID of the dashboard. Get it from newrelic_dashboards_list. Example: MXxBUE18QVBQTElDQVRJT058MTIzNDU2Nzg
  • newrelic_dashboards_listList New Relic dashboards, optionally filtered by name.Read-only

    List Dashboards

    List New Relic dashboards, optionally filtered by name. Returns the count, a nextCursor for paging, and each dashboard's guid, name, accountId, permalink, tags, permissions, owner email, parent dashboard GUID (set on pages) and created/updated times. Use this to find a dashboard GUID. Use newrelic_dashboard_get for a dashboard's pages and widgets. NerdGraph answers HTTP 200 even when the operation fails, so check the errors array in the response.

    Inputs

    cursorstring
    Pagination cursor. Pass the nextCursor value from the previous response to get the next page; leave empty for the first page. Example: Mjox
    namestring
    Return only dashboards whose name contains this text. Example: Checkout