Skip to main content
Glama

box_metadata_template_create_tool

Generate custom metadata templates for Box files and folders by defining display names, field types, and optional template keys. Streamline organization and data management for efficient content handling.

Instructions

Create a metadata template. Args: ctx (Context): The context object containing the request and lifespan context. display_name (str): The display name of the metadata template. fields (List[Dict[str, Any]]): A list of fields to include in the template. Example:{"displayName": "Customer", "fields": [ { "type": "string", "key": "name", "displayName": "Name", "description": "The customer name", "hidden": false }, { "type": "date", "key": "last_contacted_at", "displayName": "Last Contacted At", "description": "When this customer was last contacted at", "hidden": false }, { "type": "enum", "key": "industry", "displayName": "Industry", "options": [ {"key": "Technology"}, {"key": "Healthcare"}, {"key": "Legal"} ] }, { "type": "multiSelect", "key": "role", "displayName": "Contact Role", "options": [ {"key": "Developer"}, {"key": "Business Owner"}, {"key": "Marketing"}, {"key": "Legal"}, {"key": "Sales"} ] } ] }

template_key (Optional[str]): An optional key for the metadata template. If not provided, a key will be generated.

Returns: dict: The created metadata template.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
display_nameYes
fieldsYes
template_keyNo

Implementation Reference

  • The handler function that executes the tool logic: creates a Box metadata template using the box_ai_agents_toolkit library, after obtaining the Box client from context.
    async def box_metadata_template_create_tool( ctx: Context, display_name: str, fields: List[Dict[str, Any]], template_key: Optional[str] = None, ) -> dict: """ Create a new metadata template definition in Box. Args: ctx (Context): The context object containing the request and lifespan context. display_name (str): The display name of the metadata template. fields (List[Dict[str, Any]]): A list of fields to include in the template. Example:{"displayName": "Customer", "fields": [ { "type": "string", "key": "name", "displayName": "Name", "description": "The customer name", "hidden": false }, { "type": "date", "key": "last_contacted_at", "displayName": "Last Contacted At", "description": "When this customer was last contacted at", "hidden": false }, { "type": "enum", "key": "industry", "displayName": "Industry", "options": [ {"key": "Technology"}, {"key": "Healthcare"}, {"key": "Legal"} ] }, { "type": "multiSelect", "key": "role", "displayName": "Contact Role", "options": [ {"key": "Developer"}, {"key": "Business Owner"}, {"key": "Marketing"}, {"key": "Legal"}, {"key": "Sales"} ] } ] } template_key (Optional[str]): An optional key for the metadata template. If not provided, a key will be generated. Returns: dict: The created metadata template. """ box_client = get_box_client(ctx) return box_metadata_template_create( box_client, display_name, fields, template_key=template_key )
  • Registers the box_metadata_template_create_tool with the MCP server using the FastMCP tool decorator.
    mcp.tool()(box_metadata_template_create_tool)
  • Imports the box_metadata_template_create_tool from src/tools/box_tools_metadata.py for registration.
    from tools.box_tools_metadata import ( box_metadata_delete_instance_on_file_tool, box_metadata_get_instance_on_file_tool, box_metadata_set_instance_on_file_tool, box_metadata_template_create_tool, box_metadata_template_get_by_key_tool, box_metadata_template_get_by_name_tool, box_metadata_template_list_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