box_metadata_get_instance_on_file_tool
Retrieve metadata instance from a specified file and template in Box. Requires file ID and template key for precise data extraction.
Instructions
Get 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 get the metadata from. template_key (str): The key of the metadata template.
Returns: dict: The metadata instance associated with the file.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_id | Yes | ||
| template_key | Yes |
Implementation Reference
- src/tools/box_tools_metadata.py:155-173 (handler)The handler function that implements the core logic of the tool. It retrieves the Box client from context and calls the underlying box_metadata_get_instance_on_file function from the box_ai_agents_toolkit.async def box_metadata_get_instance_on_file_tool( ctx: Context, file_id: str, template_key: str, ) -> dict: """ Get 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 get the metadata from. template_key (str): The key of the metadata template. Returns: dict: The metadata instance associated with the file. """ box_client = get_box_client(ctx) return box_metadata_get_instance_on_file(box_client, file_id, template_key)
- src/tool_registry/metadata_tools.py:21-21 (registration)The registration of the tool using FastMCP's mcp.tool() decorator within the register_metadata_tools function.mcp.tool()(box_metadata_get_instance_on_file_tool)
- src/tool_registry/metadata_tools.py:3-12 (registration)The import statement in the registry file that brings in the handler function from the implementation file.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, )