genrequest_get_all
Retrieve all GenRequests associated with a specific subthread ID on the Buu AI MCP Server to manage and organize team data efficiently.
Instructions
[PRIVATE] - Get all team's GenRequests by subthread ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| subthreadId | Yes | Subthread ID to retrieve all associated GenRequests |
Implementation Reference
- src/tools/GenRequestTools.ts:203-221 (handler)The handler function that executes the 'genrequest_get_all' tool logic: performs a GraphQL query using getSubthreadGenRequestsQuery for the given subthreadId and returns the JSON response or an error.
async ({ subthreadId }) => { try { const response = await client.request(getSubthreadGenRequestsQuery, { subthreadId, }); return { content: [{ type: 'text', text: JSON.stringify(response) }] }; } catch (error) { console.error('Error calling genrequest_get_all:', error); return { isError: true, content: [ { type: 'text', text: `Error: Failed to retrieve GenRequests. ${error}`, }, ], }; } } - src/tools/GenRequestTools.ts:200-202 (schema)Input schema using Zod for the 'genrequest_get_all' tool, defining the required subthreadId parameter.
{ subthreadId: z.string().describe('Subthread ID to retrieve all associated GenRequests'), }, - src/tools/GenRequestTools.ts:197-222 (registration)Registration of the 'genrequest_get_all' tool on the MCP server using server.tool(), including description, input schema, and handler function.
server.tool( 'genrequest_get_all', "[PRIVATE] - Get all team's GenRequests by subthread ID", { subthreadId: z.string().describe('Subthread ID to retrieve all associated GenRequests'), }, async ({ subthreadId }) => { try { const response = await client.request(getSubthreadGenRequestsQuery, { subthreadId, }); return { content: [{ type: 'text', text: JSON.stringify(response) }] }; } catch (error) { console.error('Error calling genrequest_get_all:', error); return { isError: true, content: [ { type: 'text', text: `Error: Failed to retrieve GenRequests. ${error}`, }, ], }; } } ); - src/tools/GenRequestTools.ts:85-135 (helper)GraphQL query definition 'getSubthreadGenRequestsQuery' used by the genrequest_get_all handler to fetch GenRequests for a subthread.
const getSubthreadGenRequestsQuery = gql` query GetSubthreadGenRequests($subthreadId: String!) { getSubthreadGenRequests(subthreadId: $subthreadId) { ... on GenRequestsPage { items { _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 } metadata { limit offset orderBy orderDirection numElements total page pages } } ... on HandledError { code message } } } `; - src/index.ts:47-47 (registration)Invocation of registerGenRequestTools which registers the genrequest_get_all tool (among others) to the MCP server instance.
registerGenRequestTools(server, buuServerClient);