Skip to main content
Glama

fc_create_comment

Add comments to posts in FluentCommunity WordPress plugin by specifying post ID, user ID, and message content to facilitate community discussions.

Instructions

Create a new comment on a post

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
post_idYesThe post ID to comment on
user_idYesThe user ID creating the comment
messageYesComment message
parent_idNoParent comment ID for replies

Implementation Reference

  • The async handler function that executes the fc_create_comment tool, sending a POST request to the WordPress API to create a new comment on a post.
    fc_create_comment: async (args: any) => { try { const commentData: any = { post_id: args.post_id, user_id: args.user_id, message: args.message, }; if (args.parent_id) commentData.parent_id = args.parent_id; const response = await makeWordPressRequest('POST', 'fc-manager/v1/comments', commentData); return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } }; } catch (error: any) { return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } }; } },
  • Zod input schema defining the parameters for the fc_create_comment tool: post_id, user_id, and message.
    const createCommentSchema = z.object({ post_id: z.number().describe('The post ID to comment on'), user_id: z.number().describe('The user ID who creates the comment'), message: z.string().describe('Comment content') });
  • Tool registration object for fc_create_comment in the fluentCommunityTools array, including name, description, and input schema reference.
    { name: 'fc_create_comment', description: 'Create a new comment on a FluentCommunity post', inputSchema: { type: 'object', properties: createCommentSchema.shape } },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/wplaunchify/fluent-community-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server