Skip to content

Let MCP update tools change an article or product update slug - #244

Merged
s3rot0n1n merged 1 commit into
mainfrom
t3/mcp-rest-slug-title-editing
Nov 28, 2026
Merged

s3rot0n1n merged 1 commit into
mainfrom
t3/mcp-rest-slug-title-editing

Conversation

@s3rot0n1n

Copy link
Copy Markdown
Contributor

Problem

The REST update body for articles and product updates already accepts slug, but the MCP update_article / update_product_update input schemas omitted it. Unlisted keys are stripped, so agents had no way to fix a slug and fell back to deleting and recreating the content. Changing title never changes the slug (it's only derived at creation), which agents also didn't know.

Changes

  • Add optional slug (1–200 chars, same as REST) to the non-documentation update_${label} MCP tools. Documentation pages already accepted it.
  • Tool description now says slug changes the public URL immediately (unlike draft content fields) and that changing title never changes the slug.
  • InvalidSlugError / SlugConflictError now return their message (e.g. "That slug is already in use.") instead of the generic internal error. This also applies to documentation pages.

Testing

  • New test in content-output.test.ts (through the MCP SDK) for articles and product updates: title + slug update, then rejection of a taken slug. src/mcp, src/documents and api-validation suites pass (79 tests); API typecheck clean.
  • Local e2e against a fresh database: created an article over /mcp, set slug: "Short Title" → short-title; taken and --- slugs returned clear errors; after publish, slugsmoke.localhost:3002/blog/short-title rendered in the browser and the old slug returned 404.
  • QA smoke: pending a QA deploy.

🤖 Generated with Claude Code

The REST update body already accepts slug, but the MCP update_article and
update_product_update input schemas omitted it, so agents could only work
around a bad slug by deleting and recreating the content. Slug conflicts and
invalid slugs now return their message instead of a generic internal error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-28T03:22:15.682181Z 4fa2b6b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@s3rot0n1n
s3rot0n1n merged commit 6e7e744 into main Nov 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant