Skip to content

Update an existing Astro route

update_astro_route is the safe overwrite path for routes already created by create_astro_route. It refuses to touch files that lack the MCP-generated marker — preventing accidental destruction of hand-written .astro files.

update_astro_route
site_id="<astro-site-id>"
route="/pricing"
html="<section>...new content...</section>"
title="Updated pricing"
description="New tiers as of 2026-06"
sha="<previous-sha>" // optional — optimistic concurrency
force=false // default — refuse if not MCP-managed
commit_message="[astro] refresh pricing page copy"

Returns:

{
"repo": "owner/repo",
"route": "/pricing",
"path": "src/pages/pricing.astro",
"sha": "<new-sha>",
"commit_sha": "<commit-hash>",
"html_url": "https://github.com/.../blob/main/src/pages/pricing.astro",
"build_status": "pending"
}

By default the worker reads the existing file and checks for the MCP marker comment Generated by SEO Navigator MCP. If missing, it returns E_NOT_MCP_MANAGED — refusing to silently overwrite a file someone wrote in their editor.

Pass force=true to bypass:

update_astro_route
site_id="<astro-site-id>"
route="/about"
html="..."
force=true

Use this when you know the file was hand-written but you intentionally want to replace it with MCP-generated content.

If two team members try to update the same route at the same time, the second call may fail with E_SHA_MISMATCH. Refetch the route’s current sha (call list_astro_routes or re-read with the GitHub link) and retry.

Cloudflare Pages auto-rebuilds on push to the configured branch. Use check_astro_deploy (super-admin-only secret-gated tool) to poll the build status.