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
| Name | Required | Description | Default |
|---|---|---|---|
| subthreadId | Yes | ID of the subthread to fetch |
Implementation Reference
- src/tools/SubthreadTools.ts:137-149 (handler)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}` }], }; } } );
- src/tools/SubthreadTools.ts:134-136 (schema)Input schema validation for the subthread_get tool using Zod: requires a subthreadId string.{ subthreadId: z.string().describe('ID of the subthread to fetch'), },
- src/tools/SubthreadTools.ts:131-150 (registration)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}` }], }; } } );
- src/tools/SubthreadTools.ts:28-49 (helper)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);