box_ai_ask_hub_tool
Query Box AI to analyze specific hub content and generate responses based on user prompts, enabling AI-driven insights from hub data.
Instructions
Ask Box AI about a specific hub. This tool allows users to query Box AI with a specific prompt, leveraging the content of a hub in Box. The AI processes the hub and generates a response based on the provided prompt. Args: ctx (Context): The context object containing the request and lifespan context. hubs_id (str): The ID of the hub to be analyzed by the AI. prompt (str): The prompt or question to ask the AI. ai_agent_id (Optional[str]): The ID of the AI agent to use for processing. Returns: dict: The response from the AI, containing the answer to the prompt.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ai_agent_id | No | ||
| hubs_id | Yes | ||
| prompt | Yes |
Implementation Reference
- src/tools/box_tools_ai.py:62-79 (handler)Main execution handler for the box_ai_ask_hub_tool. It retrieves the Box client from context, calls box_ai_ask_hub with provided parameters, and returns the response.async def box_ai_ask_hub_tool( ctx: Context, hub_id: str, prompt: str, ai_agent_id: Optional[str] = None ) -> dict: """ Ask a question about a hub using AI. Args: ctx (Context): The context object containing the request and lifespan context. hub_id (str): The ID of the hub to ask about, example: "1234567890". prompt (str): The question to ask. ai_agent_id (Optional[str]): The ID of the AI agent to use for the question. If None, the default AI agent will be used. Returns: dict: The AI response containing the answer to the question. """ box_client = get_box_client(ctx) response = box_ai_ask_hub( box_client, hub_id, prompt=prompt, ai_agent_id=ai_agent_id ) return response
- src/tool_registry/ai_tools.py:21-21 (registration)Registers the box_ai_ask_hub_tool function as an MCP tool using the mcp.tool() decorator.mcp.tool()(box_ai_ask_hub_tool)
- src/tool_registry/ai_tools.py:9-9 (registration)Imports the box_ai_ask_hub_tool handler from src/tools/box_tools_ai.py for registration.box_ai_ask_hub_tool,