Skip to main content
Glama
box-community

MCP Server Box

box_ai_extract_structured_using_fields_tool

Extract structured data from files using custom field definitions. Define fields dynamically to create a single data record from one or multiple documents without requiring pre-existing templates.

Instructions

Extract structured data from one or more files using custom fields and return a SINGLE data instance.

This tool analyzes the provided file(s) and extracts information based on custom field definitions you provide. When multiple files are provided, Box AI combines information from ALL files to create ONE complete data record.

Unlike template-based extraction, this tool allows you to define fields on-the-fly without creating a metadata template in Box first. This is useful for ad-hoc data extraction or when you need fields that don't match any existing template.

Use cases:

  • Single file: Extract custom fields from one document (e.g., extract "contract_value" and "signing_date" from a contract)

  • Multiple files: Combine data from multiple sources into one data instance (e.g., extract "total_project_cost" from both a proposal and budget document)

NOT for batch processing: If you need to extract data 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. fields (List[dict[str, Any]]): The fields to extract from the files. example:[ { "type": "string", "key": "name", "displayName": "Name", "description": "Policyholder Name", }, { "type": "string", "key": "number", "displayName": "Number", "description": "Policy Number", }, { "type": "date", "key": "effectiveDate", "displayName": "Effective Date", "description": "Policy Effective Date", }, { "type": "enum", "key": "paymentTerms", "displayName": "Payment Terms", "description": "Frequency of payment per year", "options": [ {"key": "Monthly"}, {"key": "Quarterly"}, {"key": "Semiannual"}, {"key": "Annually"}, ], }, { "type": "multiSelect", "key": "coverageTypes", "displayName": "Coverage Types", "description": "Types of coverage for the policy", "prompt": "Look in the coverage type table and include all listed types.", "options": [ {"key": "Body Injury Liability"}, {"key": "Property Damage Liability"}, {"key": "Personal Damage Liability"}, {"key": "Collision"}, {"key": "Comprehensive"}, {"key": "Uninsured Motorist"}, {"key": "Something that does not exist"}, ], }, ]

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_idsYes
fieldsYes
ai_agent_idNo
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: that it analyzes files, combines information from multiple files into one record, returns data in JSON string format, and has specific limitations (single instance output, not for batch processing). It doesn't mention permissions, rate limits, or error handling, but covers the core operational behavior well.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections: purpose statement, behavioral explanation, use cases, exclusions, and parameter documentation. While the example is lengthy, it's necessary for understanding the complex fields parameter. The core information is front-loaded, and most sentences earn their place by adding specific value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (AI-powered extraction with custom fields), no annotations, 0% schema coverage, and no output schema, the description provides substantial context. It explains the tool's behavior, use cases, limitations, and parameters thoroughly. The main gap is the lack of output format details beyond 'json string format' - more specifics about the structure would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description must compensate, and it does so excellently. It explains all three parameters: file_ids ('IDs of the files to read'), fields ('fields to extract from the files') with a comprehensive example showing structure and options, and ai_agent_id ('ID of the AI agent to use for processing'). The example is particularly valuable for understanding the complex fields parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Extract structured data from one or more files using custom fields and return a SINGLE data instance.' It specifies the verb ('extract'), resource ('structured data from files'), and distinguishes it from sibling tools like template-based extraction tools and batch processing alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool vs alternatives. It states 'Unlike template-based extraction...' for on-the-fly field definitions, gives use cases for single and multiple files, and explicitly says 'NOT for batch processing' with an alternative approach ('call this tool once per file in a loop').

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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