Input determination
Route based on user intent:
- Like/unlike → like flow
- Favorite/unfavorite → favorite flow
- Post comment → comment flow
- Reply to comment → reply flow
Constraints
- Before executing comments and replies, show the content for the user to confirm (comments are posted publicly under the user's identity and cannot be withdrawn)
- Likes and favorites can be executed directly (operations are reversible, and the MCP service handles idempotency)
- All operations require
feed_id+xsec_token(from search or detail results; fabricating it will cause an error)
Execution flow
Like
Call like_feed:
feed_id(string, required)xsec_token(string, required)unlike(bool, optional) — true to unlike, defaults to false for like
Liking again when already liked is automatically skipped, and vice versa.
Favorite
Call favorite_feed:
feed_id(string, required)xsec_token(string, required)unfavorite(bool, optional) — true to unfavorite, defaults to false for favorite
Favoriting again when already favorited is automatically skipped, and vice versa.
Post comment
Call post_comment_to_feed:
feed_id(string, required)xsec_token(string, required)content(string, required) — comment content
Before sending, show the comment content for the user to confirm.
Reply to comment
Call reply_comment_in_feed:
feed_id(string, required)xsec_token(string, required)comment_id(string, optional) — target comment IDuser_id(string, optional) — target comment author IDcontent(string, required) — reply content
comment_id and user_id at least one must be provided.
Before sending, show the reply content for the user to confirm.
Failure handling
| Scenario | Handling |
|---|---|
| Not logged in | Guide to use xhs-login |
| Missing feed_id/xsec_token | Prompt to search or browse first to get note information |
| Note cannot be commented on | Inform the user that comments are disabled on this note |