box_upload_file_from_content_tool
Upload text or binary content as a file to Box. Specify file name, destination folder, and optional base64 encoding for seamless file management.
Instructions
Upload content as a file to Box using the toolkit.
Args: content (str | bytes): The content to upload. Can be text or binary data. file_name (str): The name to give the file in Box. folder_id (str): The ID of the destination folder. Defaults to root ("0"). is_base64 (bool): Whether the content is base64 encoded. Defaults to False.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | ||
| file_name | Yes | ||
| folder_id | No | 0 | |
| is_base64 | No |
Implementation Reference
- Handler function that executes the logic for uploading a file to Box from content (string or bytes), specifying filename and parent folder. Uses get_box_client and delegates to box_ai_agents_toolkit.box_file_upload.async def box_file_upload_tool( ctx: Context, content: str | bytes, file_name: str, parent_folder_id: str, ) -> dict[str, Any]: """ Upload content as a file to Box. Args: content (str | bytes): The content to upload. Can be text or binary data. file_name (str): The name to give the file in Box. parent_folder_id (str): The ID of the destination folder. Defaults to root ("0"). Returns: dict[str, Any]: Information about the uploaded file including id and name. """ box_client = get_box_client(ctx) return box_file_upload(box_client, content, file_name, parent_folder_id)
- src/tool_registry/file_transfer_tools.py:9-11 (registration)Registers the box_file_upload_tool as an MCP tool via the FastMCP tool decorator.def register_file_transfer_tools(mcp: FastMCP): mcp.tool()(box_file_download_tool) mcp.tool()(box_file_upload_tool)
- Imports the box_file_upload_tool function for registration.from tools.box_tools_file_transfer import ( box_file_download_tool, box_file_upload_tool, ) def register_file_transfer_tools(mcp: FastMCP): mcp.tool()(box_file_download_tool)