claudeus-wp-mcp
Version:
The most comprehensive WordPress MCP server - 145 production-ready tools for complete WordPress management with AI
85 lines • 3.03 kB
JavaScript
export async function handleCommentTools(name, args, client) {
switch (name) {
// ==========================================
// COMMENTS CRUD
// ==========================================
case 'claudeus_wp_comments__get_comments': {
const comments = await client.getComments(args.filters);
return {
content: [{
type: "text",
text: JSON.stringify(comments, null, 2)
}]
};
}
case 'claudeus_wp_comments__get_comment': {
const comment = await client.getComment(args.id, args.password);
return {
content: [{
type: "text",
text: JSON.stringify(comment, null, 2)
}]
};
}
case 'claudeus_wp_comments__create_comment': {
const comment = await client.createComment(args.data);
return {
content: [{
type: "text",
text: JSON.stringify(comment, null, 2)
}]
};
}
case 'claudeus_wp_comments__update_comment': {
const comment = await client.updateComment(args.id, args.data);
return {
content: [{
type: "text",
text: JSON.stringify(comment, null, 2)
}]
};
}
case 'claudeus_wp_comments__delete_comment': {
const result = await client.deleteComment(args.id, args.force);
return {
content: [{
type: "text",
text: JSON.stringify(result, null, 2)
}]
};
}
// ==========================================
// COMMENT MODERATION
// ==========================================
case 'claudeus_wp_comments__approve': {
const comment = await client.approveComment(args.id);
return {
content: [{
type: "text",
text: JSON.stringify(comment, null, 2)
}]
};
}
case 'claudeus_wp_comments__spam': {
const comment = await client.spamComment(args.id);
return {
content: [{
type: "text",
text: JSON.stringify(comment, null, 2)
}]
};
}
case 'claudeus_wp_comments__trash': {
const comment = await client.trashComment(args.id);
return {
content: [{
type: "text",
text: JSON.stringify(comment, null, 2)
}]
};
}
default:
throw new Error(`Unknown comment tool: ${name}`);
}
}
//# sourceMappingURL=handlers.js.map