@@ -6,7 +6,6 @@ import { getEnv } from '@repo/mcp-common/src/env'
66import type { AccountGetParams } from 'cloudflare/resources/accounts/accounts.mjs'
77import type { ReportGetParams } from 'cloudflare/resources/dns/analytics.mjs'
88import type { ZoneGetParams } from 'cloudflare/resources/dns/settings.mjs'
9- import type { ZoneListParams } from 'cloudflare/resources/zones/zones.mjs'
109import type { Env } from '../context'
1110import type { DNSAnalyticsMCP } from '../index'
1211
@@ -21,7 +20,7 @@ function getStartDate(days: number) {
2120export function registerAnalyticTools ( agent : DNSAnalyticsMCP ) {
2221 // Register DNS Report tool
2322 agent . server . tool (
24- 'dns-report ' ,
23+ 'dns_report ' ,
2524 'Fetch the DNS Report for a given zone since a date' ,
2625 {
2726 zone : z . string ( ) ,
@@ -62,7 +61,7 @@ export function registerAnalyticTools(agent: DNSAnalyticsMCP) {
6261 )
6362 // Register Account DNS Settings display tool
6463 agent . server . tool (
65- 'show-account-dns-settings ' ,
64+ 'show_account_dns_settings ' ,
6665 'Show DNS settings for current account' ,
6766 async ( ) => {
6867 try {
@@ -106,7 +105,7 @@ export function registerAnalyticTools(agent: DNSAnalyticsMCP) {
106105 )
107106 // Register Zone DNS Settings display tool
108107 agent . server . tool (
109- 'show-zone-dns-settings ' ,
108+ 'show_zone_dns_settings ' ,
110109 'Show DNS settings for a zone' ,
111110 {
112111 zone : z . string ( ) ,
@@ -140,52 +139,4 @@ export function registerAnalyticTools(agent: DNSAnalyticsMCP) {
140139 }
141140 }
142141 )
143-
144- // Register Zone DNS Settings display tool
145- agent . server . tool (
146- 'list-zones-under-account' ,
147- 'List zones under the current active account' ,
148- async ( ) => {
149- try {
150- const client = getCloudflareClient ( agent . props . accessToken )
151- const accountId = await agent . getActiveAccountId ( )
152- if ( ! accountId ) {
153- return {
154- content : [
155- {
156- type : 'text' ,
157- text : 'No currently active accountId. Try listing your accounts (accounts_list) and then setting an active account (set_active_account)' ,
158- } ,
159- ] ,
160- }
161- }
162- const zone_list_account : ZoneListParams . Account = {
163- id : accountId ,
164- }
165- const zone_list_params : ZoneListParams = {
166- account : zone_list_account ,
167- }
168- const result = await client . zones . list ( zone_list_params )
169- return {
170- content : [
171- {
172- type : 'text' ,
173- text : JSON . stringify ( {
174- result,
175- } ) ,
176- } ,
177- ] ,
178- }
179- } catch ( error ) {
180- return {
181- content : [
182- {
183- type : 'text' ,
184- text : `Error fetching DNS report: ${ error instanceof Error && error . message } ` ,
185- } ,
186- ] ,
187- }
188- }
189- }
190- )
191142}
0 commit comments