Skip to main content
Glama

fc_add_space_member

Add users to community spaces by specifying their user ID and space ID, with optional role assignment to manage member permissions.

Instructions

Add a user to a space

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
space_idYesThe space ID
user_idYesThe user ID to add
roleNoMember role in the spacemember

Implementation Reference

  • The main handler function for the fc_add_space_member tool. It constructs query parameters for user_id and role, then makes a POST request to the WordPress FluentCommunity API endpoint to add the member to the specified space.
    fc_add_space_member: async (args: any) => { try { // WordPress endpoint expects URL parameters for POST const queryParams = new URLSearchParams({ user_id: args.user_id.toString(), role: args.role || 'member', }); const response = await makeWordPressRequest('POST', `fc-manager/v1/spaces/${args.space_id}/members?${queryParams.toString()}`); 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 schema defining the input parameters for the fc_add_space_member tool: space_id (required number), user_id (required number), role (optional string, defaults to 'member').
    const addSpaceMemberSchema = z.object({ space_id: z.number().describe('The space ID'), user_id: z.number().describe('The user ID to add'), role: z.string().optional().default('member').describe('Member role in the space') });
  • Tool registration in the fluentCommunityTools array, specifying the name, description, and input schema reference.
    { name: 'fc_add_space_member', description: 'Add a user to a FluentCommunity space', inputSchema: { type: 'object', properties: addSpaceMemberSchema.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