team_get_all
Retrieve all teams for the current user with customizable pagination and filters to streamline team management in the Buu AI MCP Server.
Instructions
[PRIVATE] Get all teams for the current user.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filters | No | Filter criteria to narrow down thread results | |
| pagination | No | Pagination settings for querying threads |
Implementation Reference
- src/tools/TeamTools.ts:341-352 (handler)Handler function that executes the 'team_get_all' tool logic by calling the GraphQL 'getUserTeamsQuery' with optional pagination and filters.async ({ pagination, filters }) => { try { const response = await client.request(getUserTeamsQuery, { pagination, filters }); return { content: [{ type: 'text', text: JSON.stringify(response) }] }; } catch (error) { console.error('Error calling team_get_all:', error); return { isError: true, content: [{ type: 'text', text: `Error: Failed to retrieve all teams. ${error}` }], }; } }
- src/tools/TeamTools.ts:337-340 (schema)Input schema for the 'team_get_all' tool, defining optional pagination and filters using Zod.{ pagination: z.any().optional().describe('Pagination settings for querying threads'), filters: z.any().optional().describe('Filter criteria to narrow down thread results'), },
- src/tools/TeamTools.ts:335-353 (registration)Registration of the 'team_get_all' MCP tool using server.tool() with description, input schema, and handler.'team_get_all', '[PRIVATE] Get all teams for the current user.', { pagination: z.any().optional().describe('Pagination settings for querying threads'), filters: z.any().optional().describe('Filter criteria to narrow down thread results'), }, async ({ pagination, filters }) => { try { const response = await client.request(getUserTeamsQuery, { pagination, filters }); return { content: [{ type: 'text', text: JSON.stringify(response) }] }; } catch (error) { console.error('Error calling team_get_all:', error); return { isError: true, content: [{ type: 'text', text: `Error: Failed to retrieve all teams. ${error}` }], }; } } );
- src/tools/TeamTools.ts:175-213 (helper)GraphQL query definition 'getUserTeamsQuery' used by the team_get_all handler to fetch user's teams with pagination and filters.const getUserTeamsQuery = gql` query TeamPage($pagination: Pagination, $filters: TeamFilter) { getUserTeams(pagination: $pagination, filters: $filters) { ... on TeamPage { items { _id type name creator wallet members { address role status } available pending confirmed updatedAt createdAt } metadata { limit offset orderBy orderDirection numElements total page pages } } ... on HandledError { code message } } } `;