team_create
Create a new team for the logged-in user by specifying a team name using the input schema, simplifying team management on the Buu AI MCP Server.
Instructions
[PRIVATE] Create a new team for the logged-in user.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name of the new team |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"name": {
"description": "The name of the new team",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
}
Implementation Reference
- src/tools/TeamTools.ts:222-233 (handler)The asynchronous handler function for the 'team_create' tool that executes the GraphQL mutation to create a new team and handles the response or error.async ({ name }) => { try { const response = await client.request(createTeamMutation, { name }); return { content: [{ type: 'text', text: JSON.stringify(response) }] }; } catch (error) { console.error('Error calling team_create:', error); return { isError: true, content: [{ type: 'text', text: `Error: Failed to create team. ${error}` }], }; } }
- src/tools/TeamTools.ts:219-221 (schema)Zod input schema for the 'team_create' tool defining the required 'name' parameter.{ name: z.string().describe('The name of the new team'), },
- src/tools/TeamTools.ts:216-234 (registration)Registration of the 'team_create' tool using McpServer.tool method within registerTeamTools function.server.tool( 'team_create', '[PRIVATE] Create a new team for the logged-in user.', { name: z.string().describe('The name of the new team'), }, async ({ name }) => { try { const response = await client.request(createTeamMutation, { name }); return { content: [{ type: 'text', text: JSON.stringify(response) }] }; } catch (error) { console.error('Error calling team_create:', error); return { isError: true, content: [{ type: 'text', text: `Error: Failed to create team. ${error}` }], }; } } );
- src/tools/TeamTools.ts:7-32 (helper)GraphQL mutation query definition used by the team_create handler to create a new team.const createTeamMutation = gql` mutation CreateTeam($name: String!) { createTeam(name: $name) { ... on Team { _id type name creator wallet members { address role status } available pending confirmed updatedAt createdAt } ... on HandledError { code message } } }
- src/index.ts:49-49 (registration)Top-level call to registerTeamTools function, which registers the 'team_create' tool along with other team tools.registerTeamTools(server, buuServerClient);