Skip to main content
Glama
Buu-AI

Buu AI MCP Server

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
NameRequiredDescriptionDefault
filtersNoFilter criteria to narrow down thread results
paginationNoPagination settings for querying threads

Implementation Reference

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

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