generate_model
Create models from image URLs and link them to specific subthreads using the Buu AI MCP Server tool designed for structured data processing.
Instructions
[PRIVATE] - Generate model.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| imageRequestId | No | Optional ID of a previously generated image request | |
| imageUrl | Yes | Image URL used to generate the model | |
| subthreadId | Yes | Subthread ID where the model will be linked |
Implementation Reference
- src/tools/GenRequestTools.ts:174-194 (handler)The async handler function for the 'generate_model' tool that sends a GraphQL mutation request using generateModelQuery and returns the response or error.async ({ imageRequestId, subthreadId, imageUrl }) => { try { const response = await client.request(generateModelQuery, { imageUrl, subthreadId, imageRequestId, }); return { content: [{ type: 'text', text: JSON.stringify(response) }] }; } catch (error) { console.error('Error calling generate_model:', error); return { isError: true, content: [ { type: 'text', text: `Error: Failed to generate model. ${error}`, }, ], }; } }
- src/tools/GenRequestTools.ts:166-173 (schema)Zod schema defining the input parameters for the 'generate_model' tool: imageRequestId (optional), imageUrl, subthreadId.{ imageRequestId: z .string() .optional() .describe('Optional ID of a previously generated image request'), imageUrl: z.string().describe('Image URL used to generate the model'), subthreadId: z.string().describe('Subthread ID where the model will be linked'), },
- src/tools/GenRequestTools.ts:163-195 (registration)Registration of the 'generate_model' tool on the McpServer, including name, description, input schema, and handler.server.tool( 'generate_model', '[PRIVATE] - Generate model.', { imageRequestId: z .string() .optional() .describe('Optional ID of a previously generated image request'), imageUrl: z.string().describe('Image URL used to generate the model'), subthreadId: z.string().describe('Subthread ID where the model will be linked'), }, async ({ imageRequestId, subthreadId, imageUrl }) => { try { const response = await client.request(generateModelQuery, { imageUrl, subthreadId, imageRequestId, }); return { content: [{ type: 'text', text: JSON.stringify(response) }] }; } catch (error) { console.error('Error calling generate_model:', error); return { isError: true, content: [ { type: 'text', text: `Error: Failed to generate model. ${error}`, }, ], }; } } );
- src/tools/GenRequestTools.ts:45-83 (helper)GraphQL mutation query definition 'generateModelQuery' used by the 'generate_model' tool handler.const generateModelQuery = gql` mutation GenerateModel($imageUrl: String!, $subthreadId: String!, $imageRequestId: String) { generateModel(imageUrl: $imageUrl, subthreadId: $subthreadId, imageRequestId: $imageRequestId) { ... on GenRequest { _id subthreadId teamId status metadata type images { alt keyS3 size type url } model_mesh { alt keyS3 size type url } timings { inference } credits createdAt updatedAt address } ... on HandledError { code message } } } `;