fc_create_space
Create a new community space in FluentCommunity with customizable title, description, privacy settings, and space type for organizing discussions and content.
Instructions
Create a new space in FluentCommunity
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Space title | |
| slug | No | Space slug (URL-friendly name) | |
| description | No | Space description | |
| type | No | Space type | |
| privacy | No | Privacy setting | public |
| status | No | Space status | active |
Implementation Reference
- src/tools/fluent-community.ts:382-398 (handler)Handler function that implements fc_create_space: prepares space data (title, slug, privacy, status, description) and sends POST request to WordPress REST API endpoint 'fc-manager/v1/spaces'.fc_create_space: async (args: any) => { try { const spaceData: any = { title: args.title, slug: args.slug || args.title.toLowerCase().replace(/\s+/g, '-'), privacy: args.privacy || 'public', status: args.status || 'active', }; if (args.description) spaceData.description = args.description; const response = await makeWordPressRequest('POST', 'fc-manager/v1/spaces', spaceData); 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:59-64 (schema)Zod input schema defining parameters for fc_create_space tool: title (required), slug, description, privacy, status.const createSpaceSchema = z.object({ title: z.string().describe('Space title'), slug: z.string().optional().describe('Space slug (URL-friendly name)'), description: z.string().optional().describe('Space description'), privacy: z.enum(['public', 'private']).optional().default('public').describe('Privacy setting'), status: z.enum(['active', 'inactive']).optional().default('active').describe('Space status')
- src/tools/fluent-community.ts:204-208 (registration)Tool registration in fluentCommunityTools array (Tool[]), specifying name, description, and inputSchema from createSpaceSchema.{ name: 'fc_create_space', description: 'Create a new space in FluentCommunity', inputSchema: { type: 'object', properties: createSpaceSchema.shape } },