fc_create_post
Create new posts in FluentCommunity forums by specifying space, user, title, content, and privacy settings to publish or save as draft.
Instructions
Create a new post in FluentCommunity
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| space_id | Yes | The space ID where the post will be created | |
| user_id | Yes | The user ID who creates the post | |
| title | No | Post title | |
| message | Yes | Post content/message | |
| message_rendered | No | Rendered HTML version of the message | |
| type | No | Post type (text, video, etc.) | text |
| status | No | Post status | published |
| privacy | No | Post privacy setting | public |
| featured_image | No | URL of the featured image | |
| meta | No | Additional metadata as JSON object |
Implementation Reference
- src/tools/fluent-community.ts:318-336 (handler)The async handler function fc_create_post that executes the tool logic by constructing post data and making a POST request to the WordPress FluentCommunity endpoint.fc_create_post: async (args: any) => { try { const postData: any = { space_id: args.space_id, user_id: args.user_id, message: args.message, type: args.type || 'text', status: args.status || 'published', privacy: args.privacy || 'public', }; if (args.title) postData.title = args.title; const response = await makeWordPressRequest('POST', 'fc-manager/v1/posts', postData); 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}` }] } }; } },
- src/tools/fluent-community.ts:26-34 (schema)Zod input schema defining parameters for creating a post: space_id, user_id, title, message, type, status, privacy.const createPostSchema = z.object({ space_id: z.number().describe('The space ID where the post will be created'), user_id: z.number().describe('The user ID who creates the post'), title: z.string().optional().describe('Post title'), message: z.string().describe('Post content/message'), type: z.string().optional().default('text').describe('Post type (text, video, etc.)'), status: z.enum(['published', 'draft', 'pending']).optional().default('published').describe('Post status'), privacy: z.enum(['public', 'private', 'friends']).optional().default('public').describe('Post privacy setting') });
- src/tools/fluent-community.ts:177-181 (registration)Registration of the fc_create_post tool in the fluentCommunityTools array, linking name, description, and schema.{ name: 'fc_create_post', description: 'Create a new post in FluentCommunity', inputSchema: { type: 'object', properties: createPostSchema.shape } },