migrate_pages_to_workers_guide
Learn how to migrate Cloudflare Pages projects to Workers using this essential guide. Ensure compatibility and optimize performance with step-by-step instructions.
Instructions
ALWAYS read this guide before migrating Pages projects to Workers.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
}
Implementation Reference
- Main handler implementation for migrate_pages_to_workers_guide tool that fetches migration guide from Cloudflare documentationserver.tool( 'migrate_pages_to_workers_guide', `ALWAYS read this guide before migrating Pages projects to Workers.`, {}, { title: 'Get Pages migration guide', annotations: { readOnlyHint: true, }, }, async () => { const res = await fetch( 'https://developers.cloudflare.com/workers/prompts/pages-to-workers.txt', { cf: { cacheEverything: true, cacheTtl: 3600 }, } ) if (!res.ok) { return { content: [{ type: 'text', text: 'Error: Failed to fetch guide. Please try again.' }], } } return { content: [ { type: 'text', text: await res.text(), }, ], } } )
- Alternative handler implementation for migrate_pages_to_workers_guide tool with identical functionality using Vectorizeserver.tool( 'migrate_pages_to_workers_guide', `ALWAYS read this guide before migrating Pages projects to Workers.`, {}, { title: 'Get Pages migration guide', annotations: { readOnlyHint: true, }, }, async () => { const res = await fetch( 'https://developers.cloudflare.com/workers/prompts/pages-to-workers.txt', { cf: { cacheEverything: true, cacheTtl: 3600 }, } ) if (!res.ok) { return { content: [{ type: 'text', text: 'Error: Failed to fetch guide. Please try again.' }], } } return { content: [ { type: 'text', text: await res.text(), }, ], } } )
- apps/docs-ai-search/src/docs-ai-search.app.ts:72-72 (registration)Registration of the docs tools including migrate_pages_to_workers_guide in the MCP serverregisterDocsTools(server, env)