fc_update_post
Modify existing community posts by updating content, status, privacy settings, or metadata to maintain current and relevant discussions.
Instructions
Update an existing post in FluentCommunity
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| post_id | Yes | The ID of the post to update | |
| title | No | Post title | |
| message | No | Post content/message | |
| message_rendered | No | Rendered HTML version of the message | |
| type | No | Post type | |
| status | No | Post status | |
| privacy | No | Post privacy setting | |
| featured_image | No | URL of the featured image | |
| meta | No | Additional metadata as JSON object |
Implementation Reference
- src/tools/fluent-community.ts:338-346 (handler)The main handler function for the 'fc_update_post' tool. It extracts post_id and update data from args, makes a POST request to the WordPress API endpoint 'fc-manager/v1/posts/{post_id}', and returns the response or error.fc_update_post: async (args: any) => { try { const { post_id, ...updateData } = args; const response = await makeWordPressRequest('POST', `fc-manager/v1/posts/${post_id}`, updateData); 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:36-42 (schema)Zod schema defining the input validation for the 'fc_update_post' tool, including post_id (required), and optional fields like title, message, status, and privacy.const updatePostSchema = z.object({ post_id: z.number().describe('The ID of the post to update'), title: z.string().optional().describe('Post title'), message: z.string().optional().describe('Post content/message'), status: z.enum(['published', 'draft', 'pending', 'archived']).optional().describe('Post status'), privacy: z.enum(['public', 'private', 'friends']).optional().describe('Post privacy setting') });
- src/tools/fluent-community.ts:182-186 (registration)Tool registration in the fluentCommunityTools array, specifying the name 'fc_update_post', description, and referencing the updatePostSchema for input validation. This array is later spread into the main allTools export in src/tools/index.ts.{ name: 'fc_update_post', description: 'Update an existing FluentCommunity post', inputSchema: { type: 'object', properties: updatePostSchema.shape } },