Skip to main content
Glama
Buu-AI

Buu AI MCP Server

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
NameRequiredDescriptionDefault
imageRequestIdNoOptional ID of a previously generated image request
imageUrlYesImage URL used to generate the model
subthreadIdYesSubthread ID where the model will be linked

Implementation Reference

  • 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}`,
            },
          ],
        };
      }
    }
  • 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'),
    },
  • 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}`,
              },
            ],
          };
        }
      }
    );
  • 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
          }
        }
      }
    `;

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/Buu-AI/buu-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server