Skip to main content
Glama
box_tools_groups.py1.62 kB
from box_ai_agents_toolkit import ( box_groups_list_by_user, box_groups_list_members, box_groups_search, ) from mcp.server.fastmcp import Context from tools.box_tools_generic import get_box_client async def box_groups_search_tool(ctx: Context, query: str) -> dict: """Search for groups by name. This is a partial match search. Args: ctx (Context): The context object containing the request and lifespan context. query (str): The search query to match against group names. Returns: dict: A dictionary containing the list of matching groups.""" client = get_box_client(ctx) return box_groups_search(client, query) async def box_groups_list_members_tool(ctx: Context, group_id: str) -> dict: """List all members of a specific group. Args: ctx (Context): The context object containing the request and lifespan context. group_id (str): The ID of the group whose members are to be listed. Returns: dict: A dictionary containing the list of group members.""" client = get_box_client(ctx) return box_groups_list_members(client, group_id) async def box_groups_list_by_user_tool(ctx: Context, user_id: str) -> dict: """List all groups that a specific user belongs to. Args: ctx (Context): The context object containing the request and lifespan context. user_id (str): The ID of the user whose groups are to be listed. Returns: dict: A dictionary containing the list of groups the user belongs to.""" client = get_box_client(ctx) return box_groups_list_by_user(client, user_id)

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/box-community/mcp-server-box'

If you have feedback or need assistance with the MCP directory API, please join our Discord server