subthread_generate
Create new subthreads with customizable styles and prompts using the tool on Buu AI MCP Server. Ideal for organizing and expanding discussions or workflows efficiently.
Instructions
[PRIVATE] Generates a new subthread.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | No | Optional prompt text | |
| style | No | Optional style input for subthread generation |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"prompt": {
"description": "Optional prompt text",
"type": "string"
},
"style": {
"description": "Optional style input for subthread generation",
"enum": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13
],
"type": "number"
}
},
"type": "object"
}
Implementation Reference
- src/tools/SubthreadTools.ts:114-128 (handler)The async handler function that implements the core logic of the subthread_generate tool. It sends a GraphQL mutation with the provided style and prompt to generate a new subthread and returns the JSON response or an error.async ({ style, prompt }) => { try { const response = await client.request(generateSubthreadMutation, { style, prompt, }); return { content: [{ type: 'text', text: JSON.stringify(response) }] }; } catch (error) { console.error('Error calling subthread_generate:', error); return { isError: true, content: [{ type: 'text', text: `Error: Failed to generate subthread. ${error}` }], }; } }
- src/tools/SubthreadTools.ts:107-113 (schema)Input schema defined using Zod validators for the optional 'style' parameter (SubthreadStyle enum) and 'prompt' parameter (string).{ style: z .nativeEnum(SubthreadStyle) .optional() .describe('Optional style input for subthread generation'), prompt: z.string().optional().describe('Optional prompt text'), },
- src/tools/SubthreadTools.ts:104-129 (registration)The server.tool() call that registers the 'subthread_generate' tool, including name, description, input schema, and handler function.server.tool( 'subthread_generate', '[PRIVATE] Generates a new subthread.', { style: z .nativeEnum(SubthreadStyle) .optional() .describe('Optional style input for subthread generation'), prompt: z.string().optional().describe('Optional prompt text'), }, async ({ style, prompt }) => { try { const response = await client.request(generateSubthreadMutation, { style, prompt, }); return { content: [{ type: 'text', text: JSON.stringify(response) }] }; } catch (error) { console.error('Error calling subthread_generate:', error); return { isError: true, content: [{ type: 'text', text: `Error: Failed to generate subthread. ${error}` }], }; } } );
- src/tools/SubthreadTools.ts:86-101 (schema)Type definition enum SubthreadStyle used in the input schema for the style parameter.export enum SubthreadStyle { 'Realistic', 'LowPoly', 'Voxel', 'Stylized', 'Toon', 'SciFi', 'Fantasy', 'Wireframe', 'Clay', 'Metallic', 'Cute', 'Isometric', 'Weapons', 'Environment', }
- src/tools/SubthreadTools.ts:5-26 (helper)GraphQL mutation query definition used by the handler to perform the subthread generation.const generateSubthreadMutation = gql` mutation GenerateSubthread($style: JSON, $prompt: String) { generateSubthread(style: $style, prompt: $prompt) { ... on Subthread { _id createdAt updatedAt teamId threadId prompt style imageUrl strength address } ... on HandledError { code message } } } `;