Skip to main content
Glama

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
NameRequiredDescriptionDefault
space_idYesThe space ID where the post will be created
user_idYesThe user ID who creates the post
titleNoPost title
messageYesPost content/message
message_renderedNoRendered HTML version of the message
typeNoPost type (text, video, etc.)text
statusNoPost statuspublished
privacyNoPost privacy settingpublic
featured_imageNoURL of the featured image
metaNoAdditional metadata as JSON object

Implementation Reference

  • 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}` }] } };
      }
    },
  • 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')
    });
  • 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 }
    },

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