Repository navigation
feat(mcp): return where and since when a draft's page is live from get_content_draft, and say a ready draft comes back as it is (#1548, #1554 review) - #1559
Merged
Conversation
…t_content_draft, and say a ready draft comes back as it is (ansvisor#1548, ansvisor#1554 review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
gkhngyk
approved these changes
Oct 27, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Looks good, with follow-ups.
The two earlier follow-ups:
- #1554's: let the coach see where a page went live, and since when. Done.
DRAFT_COLUMNSselectspublished_at(content.ts:41),DraftRowhas it (:55), andgetContentDraftForreturnspublished_urlandpublished_at(:238-239).- The tool's description (
server.ts:1582), the skill's entry (SKILL.md:262-263) and the guide's row (mcp-server.mdx:304) say so. Workflow 12's step 6 points to it (SKILL.md:672-674).
- #1548's: a draft already marked ready reads as "0 tasks". Done.
- Step 5 now reads "If they marked it ready there, it's done. Otherwise offer
set_content_draft_ready" (SKILL.md:661-665). - The tool's entry says a
readyorpublisheddraft comes back as it is, withaction_tasks_done: 0(:296-298). That matchessetContentDraftReadyFor: anything butdraftandin_reviewreturns{ status, action_tasks_done: 0 }before any write.DRAFT_STATUSEShas no other status.
- Step 5 now reads "If they marked it ready there, it's done. Otherwise offer
What I checked:
- The select and the shape match. The column is selected, typed and returned under the same name. Nothing spreads the row, so no other column leaks. The other
draftForcallers (impact, sources, add source, suggest and ready) read the same row and return nothing new. - REST mirror.
GET /api/mcp/content-drafts/[id]returnsgetContentDraftFor's object as it is, so it gets both fields too. - Organization.
draftForhasn't changed:brands!inner, filtered on the key'sorganization_id. A draft of another organization is still null, so the tool answers "Draft not found" and the route answers 404. - What
published_atmeans (00262,content-published.js). Only the server writes it, and always together withpublished_url, inmarkDraftPublished. That happens when a send's callback or Webflow says the page is live, and when a person marks it published at an address. The guard (00262, kept in 00289) refuses a member's write of either. Both stay null until then. Follow-up 1 covers when it moves. - The skill's description is unchanged: 983 characters, or 984 with the newline the literal block keeps. That's the same as main and under 1,024. The PR's skill changes all start below the frontmatter.
- Tests. The new case fails without the change on all three of its checks: the select has no
published_at, and both reads lack the fields (toMatchObjectreads a missing key asundefined, notnull). The existinggetContentDraftFortests usetoMatchObject, so the two new keys don't break them. I read the tests but didn't run them. - Merge. One commit on c00e0f0. Since then, main (3b650fb, #1544) has changed only server files. It merges cleanly on main, and with #1562 and #1565 (the #1561 stack, which also touches
server.ts). - Before the API deploy. This is all web code, and the columns are already on prod (00262). After merge,
get_content_draftreturns both fields, and nothing needs the API.
Follow-ups:
published_atis when the page was last published, not when it first went live (SKILL.md:262-263,:672-674;server.ts:1582;content.ts:194).markDraftPublishedsets it to now each time. Each of these moves it to the latest time:- a new send of the same page, once the CMS or Webflow says it's live (
markDeliveryPublished: "the post updated in place"); - the Published button on a page that's already published, even when the address is saved unchanged (
publishDraft).
- a new send of the same page, once the CMS or Webflow says it's live (
- So the qualifier fits a page created in the editor too, not just an optimized page. Say a new page went live 60 days ago and was re-sent yesterday with a fix. The coach reads one day, picks 7 days, and says so.
- Fix: "since when" → "since it was last published". In step 6, replace "for an optimized page, when this version went live" with "when this version went live: a page sent again, or marked published again, moves it". Use the same words in the tool's description and the type comment.
- A
publisheddraft can have neither field (SKILL.md:262-263,:672-674).- Some drafts became Published without an address: those set before CE-013, and those marked published while the API lacks the publish route. The dialog's fallback sets the status alone (
publish-dialog.tsx:73-87), and the API on prod may still lack that route. - For such a page, "null until then" reads as "not live yet", and step 6 has no date to go on. For a new page,
get_content_impactalso answers "This draft has no live address yet". - Fix: add a line to the entry: "A
publisheddraft with neither was marked published without its address: ask where and since when it's live, and point the person to the editor's Published button (editor_path) to add the address, so its numbers can be read."
- Some drafts became Published without an address: those set before CE-013, and those marked published while the API lacks the publish route. The dialog's fallback sets the status alone (
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-ups to the reviews of #1548 and #1554, for the coach's Content Editor workflow (12).
get_content_draftsays where and since when the page is live.published_urlandpublished_at. Migration 00262 sets them together, when the page is sent to the CMS or marked published; both are null until then.get_content_impactperiod closest to how long the page has been live. Until now no tool returned that, so the coach had to ask.published_at; for an optimized page, that's when this version went live.GET /api/mcp/content-drafts/[id]) returns the same object, so it gets the two fields too.Skill wording for a draft already marked ready (#1548 review).
set_content_draft_readyruns after that, it returns the draft as it is, withaction_tasks_done: 0. The skill's "0 until then" read that as pages still waiting.set_content_draft_ready.readyorpublishedcomes back as it is, withaction_tasks_done: 0.Related issue
Follow-ups to #1554 (review item 1) and #1548 (review follow-up 1).
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
cd web && yarn vitest run src/lib/mcp/content.test.ts. The new case reads a draft before it's live (published_urlandpublished_atnull) and after (both set). It fails without the change.get_content_drafton a draft marked published in the editor (Next step › Mark published).published_urlandpublished_atare the address and time it was marked.Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Also run:
yarn test(427 files, 4,081 tests) andyarn build, both pass.🤖 Generated with Claude Code