Skip to content

Commit 5a2116a

Browse files
committed
Add base instructions to Radar MCP server
1 parent d98f86d commit 5a2116a

File tree

3 files changed

+30
-11
lines changed

3 files changed

+30
-11
lines changed

apps/radar/src/context.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,28 @@ export interface Env {
1414
DEV_CLOUDFLARE_API_TOKEN: string
1515
DEV_CLOUDFLARE_EMAIL: string
1616
}
17+
18+
export const BASE_INSTRUCTIONS = /* markdown */ `
19+
# Cloudflare Radar MCP Server
20+
21+
This server integrates tools powered by the Cloudflare Radar API to provide insights into global Internet traffic,
22+
trends, and other related utilities.
23+
24+
An active account is **only required** for URL Scanner-related tools (e.g., \`scan_url\`).
25+
26+
For tools related to Internet trends and insights, analyze the results and, when appropriate, generate visualizations
27+
such as XY charts, pie charts, bar charts, or other relevant chart types.
28+
29+
### Making comparisons
30+
31+
Many tools support **array-based filters** to enable comparisons across multiple criteria.
32+
In such cases, the array index corresponds to a distinct data series.
33+
For each data series, provide a corresponding \`dateRange\`, or alternatively a \`dateStart\` and \`dateEnd\` pair.
34+
Example: To compare HTTP traffic between Portugal and Spain over the last 7 days:
35+
- \`dateRange: ["7d", "7d"]\`
36+
- \`location: ["PT", "ES"]\`
37+
38+
This applies to date filters and other filters that support comparison across multiple values.
39+
If a tool does **not** support array-based filters, you can achieve the same comparison by making multiple separate
40+
calls to the tool.
41+
`

apps/radar/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { CloudflareMCPServer } from '@repo/mcp-common/src/server'
1313
import { registerAccountTools } from '@repo/mcp-common/src/tools/account'
1414
import { MetricsTracker } from '@repo/mcp-observability'
1515

16+
import { BASE_INSTRUCTIONS } from './context'
1617
import { registerRadarTools } from './tools/radar'
1718
import { registerUrlScannerTools } from './tools/url-scanner'
1819

@@ -58,6 +59,7 @@ export class RadarMCP extends McpAgent<Env, State, Props> {
5859
name: this.env.MCP_SERVER_NAME,
5960
version: this.env.MCP_SERVER_VERSION,
6061
},
62+
options: { instructions: BASE_INSTRUCTIONS },
6163
})
6264

6365
registerAccountTools(this)

apps/radar/src/tools/radar.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,7 @@ export function registerRadarTools(agent: RadarMCP) {
188188

189189
agent.server.tool(
190190
'get_domains_ranking',
191-
'Get top or trending domains' +
192-
'Use arrays to compare multiple filters — the array index determines which series each filter value belongs to.' +
193-
'For each filter series, you must provide a corresponding `date`.',
191+
'Get top or trending domains',
194192
{
195193
limit: PaginationLimitParam,
196194
date: DateListParam.optional(),
@@ -267,10 +265,7 @@ export function registerRadarTools(agent: RadarMCP) {
267265

268266
agent.server.tool(
269267
'get_http_requests_data',
270-
'Retrieve HTTP requests traffic trends. ' +
271-
'Use arrays to compare multiple filters — the array index determines which series each filter value belongs to.' +
272-
'For each filter series, you must provide a corresponding `dateRange`, or a `dateStart`/`dateEnd` pair. ' +
273-
'Analyze the results and generate visualizations when appropriate.',
268+
'Retrieve HTTP requests traffic trends.',
274269
{
275270
dateRange: DateRangeArrayParam.optional(),
276271
dateStart: DateStartArrayParam.optional(),
@@ -327,10 +322,7 @@ export function registerRadarTools(agent: RadarMCP) {
327322

328323
agent.server.tool(
329324
'get_l7_attack_data',
330-
'Retrieve application layer (L7) attack trends. ' +
331-
'Use arrays to compare multiple filters — the array index determines which series each filter value belongs to.' +
332-
'For each filter series, you must provide a corresponding `dateRange`, or a `dateStart`/`dateEnd` pair. ' +
333-
'Analyze the results and generate visualizations when appropriate.',
325+
'Retrieve application layer (L7) attack trends.',
334326
{
335327
dateRange: DateRangeArrayParam.optional(),
336328
dateStart: DateStartArrayParam.optional(),

0 commit comments

Comments
 (0)