Skip to content

Guide AI clients to create HTML content by default - #20

Merged
ruibaby merged 2 commits into
mainfrom
improvement/prefer-html-content-format
Nov 2, 2026
Merged

ruibaby merged 2 commits into
mainfrom
improvement/prefer-html-content-format

Conversation

@ruibaby

@ruibaby ruibaby commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Problem

The default rawType is already html, but the halo_create_post, halo_update_post, halo_create_single_page, and halo_update_single_page tool schemas described rawType as "such as html or markdown" and did not explain editor compatibility. AI clients therefore often created Markdown content, which Halo's built-in rich text editor cannot preview or edit unless a Markdown editor plugin is installed.

See #19.

Changes

  • Add a shared RAW_TYPE_DESCRIPTION in ToolSupport explaining that html is the default and is compatible with Halo's built-in rich text editor.
  • Update the raw and rawType field descriptions for post and single page create/update tools to recommend HTML body fragments, and to use Markdown only when the user explicitly requests it or confirms a Markdown editor plugin is installed.
  • Clarify that rawType is only valid when raw is provided, and tell clients to reuse the existing rawType when updating content.
  • Share DEFAULT_RAW_TYPE across tool groups so the description stays in sync with the actual default.

No runtime behavior changes; only tool metadata is updated.

Testing

  • ./gradlew spotlessApply test

Closes #19

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-02T07:28:37.702931Z
We couldn’t complete this review. Comment @codex review to try again.
d0b397c 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The update descriptions omit that rawType must be omitted when raw is absent, which can cause clients to receive INVALID_ARGUMENT for metadata-only updates in both PostTools and SinglePageTools.

1 open issue
What changed in this PR

Updates MCP tool metadata to guide AI clients toward HTML content compatible with Halo’s built-in rich text editor, addressing #19 without changing runtime behavior.

Changes:

  • Adds shared guidance recommending HTML and explaining when Markdown is appropriate.
  • Updates post and single-page create/update schemas with editor compatibility guidance and revised rawType descriptions.
File Description
src/​main/​java/​run/​halo/​mcpserver/​tools/​ToolSupport.java Defines shared content-format guidance.
src/​main/​java/​run/​halo/​mcpserver/​tools/​SinglePageTools.java Updates single-page tool field descriptions.
src/​main/​java/​run/​halo/​mcpserver/​tools/​PostTools.java Updates post tool field descriptions.

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the shared HTML default and content-format guidance changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@ruibaby
ruibaby merged commit 217dae0 into main Nov 2, 2026
2 checks passed
@ruibaby
ruibaby deleted the improvement/prefer-html-content-format branch November 2, 2026 08:22
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.

建议 AI 创建文章时优先使用 Halo 原生富文本编辑器

2 participants