Skip to main content
Glama

box_metadata_update_instance_on_file_tool

Update metadata on a file using its ID and template key. Specify metadata changes and optionally remove non-included data fields. Returns the Box API response.

Instructions

Update a metadata instance on a file.

Args: ctx (Context): The context object containing the request and lifespan context. file_id (str): The ID of the file to update the metadata on. template_key (str): The key of the metadata template. metadata (dict): The metadata to update. remove_non_included_data (bool): If True, remove data from fields not included in the metadata.

Returns: dict: The response from the Box API after updating the metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_idYes
metadataYes
remove_non_included_dataNo
template_keyYes

Implementation Reference

  • The primary handler function implementing the tool logic. It retrieves the Box client from context and calls the underlying box_ai_agents_toolkit.box_metadata_update_instance_on_file to perform the metadata update on the specified file.
    async def box_metadata_update_instance_on_file_tool( ctx: Context, file_id: str, template_key: str, metadata: dict, remove_non_included_data: bool = False, ) -> dict: """ Update the metadata template instance associated with a specific file. Args: ctx (Context): The context object containing the request and lifespan context. file_id (str): The ID of the file to update the metadata on. template_key (str): The key of the metadata template. metadata (dict): The metadata to update. remove_non_included_data (bool): If True, remove data from fields not included in the metadata. Returns: dict: The response from the Box API after updating the metadata. """ box_client = get_box_client(ctx) return box_metadata_update_instance_on_file( box_client, file_id, template_key, metadata, remove_non_included_data=remove_non_included_data, )
  • The registration of the tool using the MCP FastMCP mcp.tool() decorator in the metadata tools registry.
    mcp.tool()(box_metadata_update_instance_on_file_tool)

Other Tools

Related Tools

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