Skip to main content
Glama

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
NameRequiredDescriptionDefault
contentYes
file_nameYes
folder_idNo0
is_base64No

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)
  • 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)

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