Skip to main content
Glama
Buu-AI

Buu AI MCP Server

subthread_get

Retrieve a team's subthread using its unique ID to access specific conversation details within the Buu AI MCP Server.

Instructions

[PRIVATE] Get team's subthread by ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subthreadIdYesID of the subthread to fetch

Implementation Reference

  • The async handler function for the 'subthread_get' tool. It takes a subthreadId, queries the GraphQL client using getSubthreadQuery, and returns the response or an error.
      async ({ subthreadId }) => {
        try {
          const response = await client.request(getSubthreadQuery, { subthreadId });
          return { content: [{ type: 'text', text: JSON.stringify(response) }] };
        } catch (error) {
          console.error('Error calling subthread_get:', error);
          return {
            isError: true,
            content: [{ type: 'text', text: `Error: Failed to retrieve subthread. ${error}` }],
          };
        }
      }
    );
  • Input schema validation for the subthread_get tool using Zod: requires a subthreadId string.
    {
      subthreadId: z.string().describe('ID of the subthread to fetch'),
    },
  • Registration of the 'subthread_get' tool using server.tool(), including description, input schema, and inline handler function.
    server.tool(
      'subthread_get',
      "[PRIVATE] Get team's subthread by ID.",
      {
        subthreadId: z.string().describe('ID of the subthread to fetch'),
      },
      async ({ subthreadId }) => {
        try {
          const response = await client.request(getSubthreadQuery, { subthreadId });
          return { content: [{ type: 'text', text: JSON.stringify(response) }] };
        } catch (error) {
          console.error('Error calling subthread_get:', error);
          return {
            isError: true,
            content: [{ type: 'text', text: `Error: Failed to retrieve subthread. ${error}` }],
          };
        }
      }
    );
  • GraphQL query 'getSubthreadQuery' definition used by the subthread_get handler to fetch the subthread details by ID.
    const getSubthreadQuery = gql`
      query Subthread($subthreadId: String!) {
        getSubthread(subthreadId: $subthreadId) {
          ... on Subthread {
            _id
            createdAt
            updatedAt
            teamId
            threadId
            prompt
            style
            imageUrl
            strength
            address
          }
          ... on HandledError {
            code
            message
          }
        }
      }
    `;
  • src/index.ts:48-48 (registration)
    Call to registerSubthreadTools on the main MCP server instance, which registers the subthread_get tool among others.
    registerSubthreadTools(server, buuServerClient);

Tool Definition Quality

Score is being calculated. Check back soon.

Install Server

Other Tools

Related Tools

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