box_ai_ask_file_single_tool
Query Box AI to analyze a specific file and generate responses based on a provided prompt. Use this tool to extract insights or answers directly from file content stored in Box.
Instructions
Ask Box AI about a single file. This tool allows users to query Box AI with a specific prompt, leveraging the content of a single file stored in Box. The AI processes the file and generates a response based on the provided prompt. Args: ctx (Context): The context object containing the request and lifespan context. file_id (str): The ID of the file 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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ai_agent_id | No | ||
| file_id | Yes | ||
| prompt | Yes |
Implementation Reference
- src/tools/box_tools_ai.py:21-39 (handler)The main handler function that implements the box_ai_ask_file_single_tool logic. It retrieves a Box client from context, calls the underlying box_ai_ask_file_single function, and returns the response.async def box_ai_ask_file_single_tool( ctx: Context, file_id: str, prompt: str, ai_agent_id: Optional[str] = None ) -> dict: """ Ask a question about a file using AI. Args: ctx (Context): The context object containing the request and lifespan context. file_id (str): The ID of the file 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_file_single( box_client, file_id, prompt=prompt, ai_agent_id=ai_agent_id ) return response
- src/tool_registry/ai_tools.py:19-19 (registration)The registration of the box_ai_ask_file_single_tool using mcp.tool() decorator in the AI tools registry.mcp.tool()(box_ai_ask_file_single_tool)
- src/tool_registry/ai_tools.py:8-8 (registration)Import of the box_ai_ask_file_single_tool handler from src/tools/box_tools_ai.py.box_ai_ask_file_single_tool,