get_account_details
Retrieve New Relic account information to view configuration, settings, and metadata for monitoring and management purposes.
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)The core handler function in NewRelicClient that executes a NerdGraph GraphQL query to fetch and return account details (ID and name) for the specified account ID.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:89-100 (registration)Tool registration definition including name, description, and input schema. Added to the tools array and registered via this.tools.set().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:91-99 (schema)Input schema definition for the tool, specifying optional target_account_id parameter.inputSchema: { type: 'object' as const, properties: { target_account_id: { type: 'string' as const, description: 'Optional account ID to get details for', }, }, },
- src/client/newrelic-client.ts:19-23 (schema)TypeScript interface defining the output structure of account details.export interface AccountDetails { accountId: string; name: string; region?: string; }
- src/server.ts:203-204 (handler)Server-side dispatch handler that routes the tool call to the NewRelicClient.getAccountDetails method.case 'get_account_details': return await this.client.getAccountDetails(accountId);