Enabling Tools on Columns

View as Markdown

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:

1import data_designer.config as dd
2
3builder.add_column(
4 dd.LLMTextColumnConfig(
5 name="answer",
6 prompt="Use tools as needed to answer: {{ question }}",
7 model_alias="nvidia-text",
8 tool_alias="my-tools", # References a ToolConfig
9 )
10)

Supported Column Types

Tool use is supported on these column configuration types:

Column TypeDescription
LLMTextColumnConfigText generation with tool access
LLMCodeColumnConfigCode generation with tool access
LLMStructuredColumnConfigStructured JSON generation with tool access
LLMJudgeColumnConfigJudge/scoring with tool access

How It Works

When tool_alias is specified:

  1. Tool schemas are fetched from the referenced MCP providers
  2. Model receives tool schemas with the prompt
  3. Model can request tool calls in its response
  4. Data Designer executes calls and returns results to the model
  5. Iteration continues until the model produces a final answer (or limits are reached)

Complete Example

Here’s a complete workflow showing provider → ToolConfig → column:

1import data_designer.config as dd
2from data_designer.interface import DataDesigner
3
4# 1. Configure MCP provider
5mcp_provider = dd.LocalStdioMCPProvider(
6 name="demo-mcp",
7 command="python",
8 args=["-m", "my_mcp_server"],
9)
10
11# 2. Create DataDesigner instance with provider
12data_designer = DataDesigner(mcp_providers=[mcp_provider])
13
14# 3. Define tool configuration
15tool_config = dd.ToolConfig(
16 tool_alias="my-tools",
17 providers=["demo-mcp"],
18 allow_tools=["search_docs", "get_fact"],
19 max_tool_call_turns=5,
20)
21
22# 4. Create config builder with tool config
23builder = dd.DataDesignerConfigBuilder(tool_configs=[tool_config])
24
25# 5. Add columns that use tools
26builder.add_column(
27 dd.SamplerColumnConfig(
28 name="question",
29 sampler_type=dd.SamplerType.CATEGORY,
30 params=dd.CategorySamplerParams(
31 values=["What is machine learning?", "Explain neural networks"]
32 ),
33 )
34)
35
36builder.add_column(
37 dd.LLMTextColumnConfig(
38 name="answer",
39 prompt="Use the available tools to research and answer: {{ question }}",
40 model_alias="nvidia-text",
41 tool_alias="my-tools", # Enable tools
42 with_trace=dd.TraceType.ALL_MESSAGES, # Capture tool call history
43 )
44)
45
46# 6. Generate data
47results = data_designer.preview(builder, num_records=5)

See Also