Enabling Tools on Columns
This guide explains how to enable tool use on LLM columns by connecting them to tool configurations via the tool_alias parameter.
Overview
To enable tool use on an LLM column, you reference a ToolConfig by its alias. During generation, the model can then request tool calls, and Data Designer executes them and feeds the results back to the model.
Using tool_alias
Add the tool_alias parameter to any supported LLM column configuration:
import data_designer.config as dd
builder.add_column(
dd.LLMTextColumnConfig(
name="answer",
prompt="Use tools as needed to answer: {{ question }}",
model_alias="nvidia-text",
tool_alias="my-tools", # References a ToolConfig
)
)
Supported Column Types
Tool use is supported on these column configuration types:
| Column Type | Description |
|---|---|
LLMTextColumnConfig |
Text generation with tool access |
LLMCodeColumnConfig |
Code generation with tool access |
LLMStructuredColumnConfig |
Structured JSON generation with tool access |
LLMJudgeColumnConfig |
Judge/scoring with tool access |
How It Works
When tool_alias is specified:
- Tool schemas are fetched from the referenced MCP providers
- Model receives tool schemas with the prompt
- Model can request tool calls in its response
- Data Designer executes calls and returns results to the model
- Iteration continues until the model produces a final answer (or limits are reached)
Complete Example
Here's a complete workflow showing provider → ToolConfig → column:
import data_designer.config as dd
from data_designer.interface import DataDesigner
# 1. Configure MCP provider
mcp_provider = dd.LocalStdioMCPProvider(
name="demo-mcp",
command="python",
args=["-m", "my_mcp_server"],
)
# 2. Create DataDesigner instance with provider
data_designer = DataDesigner(mcp_providers=[mcp_provider])
# 3. Define tool configuration
tool_config = dd.ToolConfig(
tool_alias="my-tools",
providers=["demo-mcp"],
allow_tools=["search_docs", "get_fact"],
max_tool_call_turns=5,
)
# 4. Create config builder with tool config
builder = dd.DataDesignerConfigBuilder(tool_configs=[tool_config])
# 5. Add columns that use tools
builder.add_column(
dd.SamplerColumnConfig(
name="question",
sampler_type=dd.SamplerType.CATEGORY,
params=dd.CategorySamplerParams(
values=["What is machine learning?", "Explain neural networks"]
),
)
)
builder.add_column(
dd.LLMTextColumnConfig(
name="answer",
prompt="Use the available tools to research and answer: {{ question }}",
model_alias="nvidia-text",
tool_alias="my-tools", # Enable tools
with_trace=dd.TraceType.ALL_MESSAGES, # Capture tool call history
)
)
# 6. Generate data
results = data_designer.preview(builder, num_records=5)
See Also
- Tool Configurations: Configure tool access and limits
- Traces: Capture and inspect tool call history
- MCP Providers: Configure MCP server connections