Use when working with Alloydb — google AlloyDB instance analysis, query insights, columnar engine optimization, maintenance windows, and cluster health.
日本語の概要は準備中です。原文の説明を表示しています。
Cloudflare GraphQL Analytics for zone traffic, firewall events, Workers metrics, and schema exploration. Use when querying Cloudflare analytics data or exploring the GraphQL API.
インストール方法を見るインストールする前に、エージェントに与えられる指示の中身を確認できます。
What discovery provides:
accounts: List of Cloudflare accounts with id, namezones: Zone details with id, name, status, accountId, accountName, plandataRetention: Retention windows by data type (DNS, HTTP, firewall, workers) based on plan tieravailableDatasets: GraphQL datasets with name, scope (account/zone), variableType (Date!/Time!), retentionqueryHints:
criticalRequirement: Must call graphql_zones_list() before DNS queriescorrectWorkflow: Step-by-step workflow for queriesvariableTypes: Which datasets use Date! vs Time!scopeRequirements: Which datasets are account-level vs zone-levelsafeDateRanges: Pre-calculated safe date ranges based on retentionWhy run discovery:
accountId required for DNS/Workers querieszoneId required for HTTP/Firewall queriesOutput Formatting:
Use format() for token-efficient output (40-60% token savings):
import { format } from "@connections/_utils/format";
console.log(format(result)); // CORRECT - Uses TOON encoding
// console.log(JSON.stringify(result, null, 2)); // WRONG - Wastes tokens
🚨 MUST call graphql_zones_list({ name: 'domain.com' }) BEFORE querying DNS analytics
🚨 CRITICAL: graphql_graphql_query Response Handling
The graphql_graphql_query tool returns a STRING containing:
\n\n)Example response format:
{"data":{...},"errors":null}
**[Open in GraphQL Explorer](https://graphql.cloudflare.com/explorer?query=...)**
MANDATORY parsing pattern:
// ✅ CORRECT - Extract JSON before parsing
const resultStr = result as string;
const jsonPart = resultStr.split('\n\n')[0]; // Remove markdown link
const parsed = JSON.parse(jsonPart);
// ❌ WRONG - Parsing full string fails with "Unrecognized token '*'"
const parsed = JSON.parse(result as string); // Error!
Always check for GraphQL errors before accessing data:
if (parsed.errors && parsed.errors.length > 0) {
console.error('GraphQL Errors:', format(parsed.errors));
process.exit(1);
}
const data = parsed.data?.viewer?.accounts?.[0]?.dnsAnalyticsAdaptiveGroups || [];
Format requirements:
Date! format ("2026-01-27")Time! format ("2026-01-27T00:00:00Z")Scope requirements:
viewer.accounts)viewer.zones)Retention (Free plan):
import { graphql_zones_list, graphql_graphql_query } from '@connections/cloudflare';
import { format } from '@connections/_utils/format';
async function queryDNS() {
// Step 1: CRITICAL - Establish zone context
const zonesResult = await graphql_zones_list({ name: 'cloudthinker.io' });
const zones = typeof zonesResult === 'string' ? JSON.parse(zonesResult) : zonesResult;
const accountId = zones.zones[0].account.id;
// Step 2: Query with Date! format
const query = `query($accountTag: string!, $start: Date!, $end: Date!) {
viewer {
accounts(filter: { accountTag: $accountTag }) {
dnsAnalyticsAdaptiveGroups(
filter: { date_geq: $start, date_leq: $end }
limit: 1000
) {
count
dimensions { queryName queryType responseCode }
}
}
}
}`;
const result = await graphql_graphql_query({
query,
variables: { accountTag: accountId, start: '2026-01-27', end: '2026-01-28' }
});
// Step 3: CRITICAL - Extract JSON before parsing (remove markdown link)
const resultStr = result as string;
const jsonPart = resultStr.split('\n\n')[0];
const parsed = JSON.parse(jsonPart);
// Step 4: Check for GraphQL errors
if (parsed.errors && parsed.errors.length > 0) {
console.error('GraphQL Errors:', format(parsed.errors));
process.exit(1);
}
// Step 5: Access the data
const dnsData = parsed.data?.viewer?.accounts?.[0]?.dnsAnalyticsAdaptiveGroups || [];
if (dnsData.length === 0) {
console.log('No DNS data available for the specified period');
process.exit(0);
}
// Step 6: Display results with format() for token efficiency
console.log(format(dnsData));
}
queryDNS();
// MUST establish zone context first
const zonesResult = await graphql_zones_list({ name: 'example.com' });
const zones = typeof zonesResult === 'string' ? JSON.parse(zonesResult) : zonesResult;
const accountTag = zones.zones[0].account.id;
const result = await graphql_graphql_query({
query: `query($accountTag: string!, $start: Date!, $end: Date!) {
viewer { accounts(filter: { accountTag: $accountTag }) {
dnsAnalyticsAdaptiveGroups(
filter: { date_geq: $start, date_leq: $end }
limit: 1000
) {
count
dimensions { queryName queryType responseCode zoneName }
}
}}
}`,
variables: {
accountTag,
start: '2026-01-27', // Date! format, within 7 days
end: '2026-01-28'
}
});
// CRITICAL: Extract JSON before parsing
const resultStr = result as string;
const jsonPart = resultStr.split('\n\n')[0];
const parsed = JSON.parse(jsonPart);
if (parsed.errors) {
console.error('Errors:', format(parsed.errors));
process.exit(1);
}
const dnsData = parsed.data?.viewer?.accounts?.[0]?.dnsAnalyticsAdaptiveGroups || [];
const zonesResult = await graphql_zones_list({});
const zones = typeof zonesResult === 'string' ? JSON.parse(zonesResult) : zonesResult;
const zoneTag = zones.zones.find(z => z.name === 'example.com')?.id;
const result = await graphql_graphql_query({
query: `query($zoneTag: string!, $start: Time!, $end: Time!) {
viewer { zones(filter: { zoneTag: $zoneTag }) {
httpRequests1hGroups(
filter: { datetime_geq: $start, datetime_lt: $end }
limit: 24
) {
dimensions { datetime }
sum { requests bytes cachedRequests }
}
}}
}`,
variables: {
zoneTag,
start: '2026-01-10T00:00:00Z', // Time! format
end: '2026-01-11T00:00:00Z'
}
});
// CRITICAL: Extract JSON before parsing
const resultStr = result as string;
const jsonPart = resultStr.split('\n\n')[0];
const parsed = JSON.parse(jsonPart);
if (parsed.errors) {
console.error('Errors:', format(parsed.errors));
process.exit(1);
}
const httpData = parsed.data?.viewer?.zones?.[0]?.httpRequests1hGroups || [];
const result = await graphql_graphql_query({
query: `query($zoneTag: string!, $start: Time!, $end: Time!) {
viewer { zones(filter: { zoneTag: $zoneTag }) {
firewallEventsAdaptive(
filter: { datetime_geq: $start, datetime_leq: $end }
limit: 100
) {
action clientCountryName clientIP clientRequestPath datetime
}
}}
}`,
variables: { zoneTag, start, end }
});
// CRITICAL: Extract JSON before parsing
const resultStr = result as string;
const jsonPart = resultStr.split('\n\n')[0];
const parsed = JSON.parse(jsonPart);
if (parsed.errors) {
console.error('Errors:', format(parsed.errors));
process.exit(1);
}
const firewallEvents = parsed.data?.viewer?.zones?.[0]?.firewallEventsAdaptive || [];
const zonesResult = await graphql_zones_list({});
const zones = typeof zonesResult === 'string' ? JSON.parse(zonesResult) : zonesResult;
const accountTag = zones.zones[0].account.id;
const result = await graphql_graphql_query({
query: `query($accountTag: string!, $scriptName: string!, $start: Time!, $end: Time!) {
viewer { accounts(filter: { accountTag: $accountTag }) {
workersInvocationsAdaptive(
filter: { scriptName: $scriptName, datetime_geq: $start }
limit: 100
) {
dimensions { datetime scriptName status }
sum { requests errors }
}
}}
}`,
variables: { accountTag, scriptName, start, end }
});
// CRITICAL: Extract JSON before parsing
const resultStr = result as string;
const jsonPart = resultStr.split('\n\n')[0];
const parsed = JSON.parse(jsonPart);
if (parsed.errors) {
console.error('Errors:', format(parsed.errors));
process.exit(1);
}
const workersData = parsed.data?.viewer?.accounts?.[0]?.workersInvocationsAdaptive || [];
graphql_zones_list({ name: 'example.com' })JSON.parse(zonesResult)zones.zones[0].account.idJSON.parse(result.split('\n\n')[0])graphql_zones_list({})JSON.parse(zonesResult)JSON.parse(result.split('\n\n')[0])parsed.data.viewer.zones[0].httpRequests1hGroupsgraphql_zones_list({})JSON.parse(zonesResult)JSON.parse(result.split('\n\n')[0])action: "block"| Error | Cause | Fix |
|---|---|---|
JSON Parse error: Unrecognized token '*' | Markdown link in response | Use result.split('\n\n')[0] before parsing |
| DNS returns 0 records | No zone context | MUST call graphql_zones_list({ name: 'domain.com' }) first |
| Type mismatch | Wrong variable type | DNS=Date!, others=Time! |
| HTTP returns 0 records | Wrong type or old dates | Use Time! + dates within 31 days |
Cannot read property 'data' of undefined | Didn't parse response | Always JSON.parse(result.split('\n\n')[0]) |
DNS returns 0 records?
graphql_zones_list({ name: 'domain.com' }) FIRST?
graphql_zones_list({}) without name → may return 0 recordsDate! format (not Time!)?viewer.accounts (not viewer.zones)?Still returns 0 records with correct workflow?
| Dataset | Scope | Var Type | Retention (Free) |
|---|---|---|---|
dnsAnalyticsAdaptiveGroups | Account | Date! | 7 days |
httpRequests1hGroups | Zone | Time! | 31 days |
firewallEventsAdaptive | Zone | Time! | 30 days |
workersInvocationsAdaptive | Account | Time! | 30 days |
| Operator | Example | Description |
|---|---|---|
_eq | action_eq: "block" | Equals |
_geq, _gte | datetime_geq: $start | Greater than or equal |
_leq, _lte | datetime_leq: $end | Less than or equal |
_in | action_in: ["block", "challenge"] | In list |
Every graphql_graphql_query call MUST follow this pattern:
import { graphql_graphql_query } from '@connections/cloudflare';
import { format } from '@connections/_utils/format';
try {
const result = await graphql_graphql_query({ query, variables });
// Step 1: Extract JSON portion (remove markdown link)
const resultStr = result as string;
const jsonPart = resultStr.split('\n\n')[0];
// Step 2: Parse JSON
const parsed = JSON.parse(jsonPart);
// Step 3: Check for GraphQL errors
if (parsed.errors && parsed.errors.length > 0) {
console.error('GraphQL Errors:');
console.error(format(parsed.errors));
process.exit(1);
}
// Step 4: Access data with fallback
const data = parsed.data?.viewer?.accounts?.[0]?.dnsAnalyticsAdaptiveGroups || [];
// Step 5: Handle empty results
if (data.length === 0) {
console.log('No data available for the specified period');
console.log('Note: Check date range, retention limits, and plan tier');
process.exit(0);
}
// Step 6: Display results with format() for token efficiency
console.log(format(data));
} catch (error) {
console.error('Query execution failed:', error);
process.exit(1);
}
\n\n**[Open in GraphQL Explorer](...)** breaks JSON.parseerrors array even with 200 statusformat() instead of JSON.stringify()// ✅ CORRECT
const resultStr = result as string;
const jsonPart = resultStr.split('\n\n')[0];
const parsed = JSON.parse(jsonPart);
// ❌ WRONG - Will fail with "Unrecognized token '*'"
const parsed = JSON.parse(result as string);
// ❌ WRONG - Assumes object response
const data = result.data?.viewer?.accounts;
// ✅ CORRECT - Check errors before accessing data
if (parsed.errors) {
console.error('Errors:', format(parsed.errors));
process.exit(1);
}
// ✅ CORRECT - Use format() for output
console.log(format(data));
// ❌ WRONG - Wastes tokens
console.log(JSON.stringify(data, null, 2));
Present results as a structured report:
Analytics Cloudflare Report
═══════════════════════════
Resources discovered: [count]
Resource Status Key Metric Issues
──────────────────────────────────────────────
[name] [ok/warn] [value] [findings]
Summary: [total] resources | [ok] healthy | [warn] warnings | [crit] critical
Action Items: [list of prioritized findings]
Target ≤50 lines of output. Use tables for multi-resource comparisons.
--help output.| Shortcut | Counter | Why |
|---|---|---|
| "I'll skip discovery and check known resources" | Always run Phase 1 discovery first | Resource names change, new resources appear — assumed names cause errors |
| "The user only asked for a quick check" | Follow the full discovery → analysis flow | Quick checks miss critical issues; structured analysis catches silent failures |
| "Default configuration is probably fine" | Audit configuration explicitly | Defaults often leave logging, security, and optimization features disabled |
| "Metrics aren't needed for this" | Always check relevant metrics when available | API/CLI responses show current state; metrics reveal trends and intermittent issues |
| "I don't have access to that" | Try the command and report the actual error | Assumed permission failures prevent useful investigation; actual errors are informative |
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Use when working with Alloydb — google AlloyDB instance analysis, query insights, columnar engine optimization, maintenance windows, and cluster health.
日本語の概要は準備中です。原文の説明を表示しています。
Use when working with Aqua — aqua Security platform analysis. Covers container runtime protection, image assurance policies, compliance frameworks, vulnerability management, workload protection, and registry scanning. Use when analyzing container security posture, reviewing image compliance, investigating runtime alerts, or auditing security policies.
日本語の概要は準備中です。原文の説明を表示しています。
Use when working with Bigquery — google BigQuery job analysis, slot utilization, cost analysis, dataset management, and query optimization.
日本語の概要は準備中です。原文の説明を表示しています。
Use when working with Cassandra — apache Cassandra keyspace analysis, compaction strategies, repair status, nodetool operations, and cluster health monitoring.
日本語の概要は準備中です。原文の説明を表示しています。
Use when working with Checkov — checkov infrastructure-as-code security scanning. Covers Terraform, CloudFormation, Kubernetes, and Dockerfile scanning, policy management, custom checks, compliance frameworks, and suppression management. Use when scanning IaC for security misconfigurations, evaluating compliance, managing custom policies, or reviewing scan results.
日本語の概要は準備中です。原文の説明を表示しています。
Use when working with Clickhouse — clickHouse table analysis, MergeTree optimization, query performance tuning, parts management, and cluster health.
日本語の概要は準備中です。原文の説明を表示しています。