box_ai_extract_structured_using_template_tool
Extract structured data from one or more files into a single metadata record using a specified template, combining all provided files.
Instructions
Extract structured data from one or more files and return a SINGLE metadata instance.
This tool analyzes the provided file(s) and extracts information to populate a single metadata instance based on the specified template. When multiple files are provided, Box AI combines information from ALL files to create ONE complete metadata record.
Use cases:
Single file: Extract metadata from one receipt, invoice, or document
Multiple files: Combine data from multiple sources into one metadata instance (e.g., extract customer info from both a contract PDF and a supporting letter)
NOT for batch processing: If you need to extract metadata from multiple files as separate instances, call this tool once per file in a loop.
Args: ctx (Context): The context object containing the request and lifespan context. file_ids (List[str]): The IDs of the files to read. template_key (str): The ID of the template to use for extraction. ai_agent_id (Optional[str]): The ID of the AI agent to use for processing. Returns: dict: The extracted structured data in a json string format.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file_ids": "<file_ids>",
"template_key": "<template_key>"
},
"name": "box_ai_extract_structured_using_template_tool"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_ids | Yes | ||
| ai_agent_id | No | ||
| template_key | Yes |