get_account_details
Retrieve New Relic account details, including optional account ID, to manage data queries, incidents, synthetic monitoring, and deployments via the MCP Server.
Instructions
Get New Relic account details
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target_account_id | No | Optional account ID to get details for |
Implementation Reference
- src/client/newrelic-client.ts:64-92 (handler)Core handler function that executes the NerdGraph GraphQL query to fetch account details.async getAccountDetails(accountId?: string): Promise<AccountDetails> { const id = accountId || this.defaultAccountId; if (!id) { throw new Error('Account ID must be provided'); } type AccountResponse = { actor?: { account?: { id: string; name: string } } }; const query = `{ actor { account(id: ${id}) { id name } } }`; const response = (await this.executeNerdGraphQuery<AccountResponse>( query )) as GraphQLResponse<AccountResponse>; if (!response.data?.actor?.account) { throw new Error(`Account ${id} not found`); } return { accountId: response.data.actor.account.id, name: response.data.actor.account.name, }; }
- src/server.ts:88-100 (registration)Tool registration in the tools array, including name, description, and input schema.{ name: 'get_account_details', description: 'Get New Relic account details', inputSchema: { type: 'object' as const, properties: { target_account_id: { type: 'string' as const, description: 'Optional account ID to get details for', }, }, }, },
- src/server.ts:203-204 (handler)Dispatch handler in executeTool method that calls the client implementation.case 'get_account_details': return await this.client.getAccountDetails(accountId);
- src/client/newrelic-client.ts:19-23 (schema)TypeScript interface defining the output structure of getAccountDetails.export interface AccountDetails { accountId: string; name: string; region?: string; }