@tpmjs/tools-cloudflare
Update an existing DNS record in a Cloudflare zone.
Test @tpmjs/tools-cloudflare (updateDnsRecord) with AI-powered execution
0/2000 characters
Install this tool and use it with the AI SDK
npm install @tpmjs/tools-cloudflarepnpm add @tpmjs/tools-cloudflareyarn add @tpmjs/tools-cloudflarebun add @tpmjs/tools-cloudflaredeno add npm:@tpmjs/tools-cloudflareimport { updateDnsRecord } from '@tpmjs/tools-cloudflare';import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { updateDnsRecord } from '@tpmjs/tools-cloudflare';
const result = await generateText({
model: openai('gpt-4o'),
tools: { updateDnsRecord },
prompt: 'Your prompt here...',
});
console.log(result.text);(name: string, type: string, content: string, zone_id: string, record_id: string, ttl?: number, proxied?: boolean) => Promise<unknown>Available configuration options
zone_idstringThe zone ID containing the DNS record
record_idstringThe DNS record ID to update
typestringDNS record type (A, AAAA, CNAME, MX, TXT, etc.)
namestringDNS record name (e.g., "example.com" or "subdomain.example.com")
contentstringDNS record content (e.g., IP address for A record, domain for CNAME)
ttlnumberTime to live in seconds (1 = automatic)
proxiedbooleanWhether the record is proxied through Cloudflare
Schema extracted: 3/1/2026, 4:26:08 AM
Cloudflare API tools for AI agents. Manage DNS records, zones, Workers, KV namespaces, and purge cache.
npm install @tpmjs/tools-cloudflare
Set your Cloudflare API token and account ID:
export CLOUDFLARE_API_TOKEN="..." export CLOUDFLARE_ACCOUNT_ID="..." # Required for Workers and KV operations
import { listZones, listDnsRecords, createDnsRecord } from '@tpmjs/tools-cloudflare'; const zones = await listZones.execute({ per_page: 10 }); const records = await listDnsRecords.execute({ zone_id: 'abc123', type: 'A' }); const newRecord = await createDnsRecord.execute({ zone_id: 'abc123', type: 'A', name: 'app.example.com', content: '1.2.3.4', proxied: true, });
| Tool | Description |
|---|---|
listZones | List zones with name and status filters |
getZone | Get details of a specific zone |
purgeCache | Purge cached content by URLs or purge everything |
listDnsRecords | List DNS records with type and name filters |
createDnsRecord | Create a new DNS record |
updateDnsRecord | Update an existing DNS record |
deleteDnsRecord | Delete a DNS record |
listWorkers | List all Workers scripts |
getWorker | Get metadata for a Worker script |
deleteWorker | Delete a Worker script |
listKvNamespaces | List KV namespaces |
listKvKeys | List keys in a KV namespace |
getKvValue | Get a value from KV |
putKvValue | Write a key-value pair to KV |
deleteKvKey | Delete a key from KV |
MIT
Downloads/month
182
GitHub Stars
0
Quality Score