4545from fenic .core ._logical_plan .plans .base import LogicalPlan
4646from fenic .core ._utils .schema import convert_custom_dtype_to_polars
4747from fenic .core .error import ConfigurationError , ValidationError
48- from fenic .core .mcp .types import SystemToolDefinition , TableFormat
48+ from fenic .core .mcp .types import SystemTool , TableFormat
4949from fenic .core .types .datatypes import (
5050 BooleanType ,
5151 DoubleType ,
@@ -92,7 +92,7 @@ def auto_generate_system_tools_from_tables(
9292 * ,
9393 tool_group_name : str ,
9494 max_result_limit : int = 100 ,
95- ) -> List [SystemToolDefinition ]:
95+ ) -> List [SystemTool ]:
9696 """Generate Schema/Profile/Read/Search/Analyze tools from catalog tables.
9797
9898 Validates that each table exists and has a non-empty description in catalog metadata.
@@ -112,7 +112,7 @@ def _auto_generate_read_tool(
112112 tool_description : str ,
113113 * ,
114114 result_limit : int = 50 ,
115- ) -> SystemToolDefinition :
115+ ) -> SystemTool :
116116 """Create a read tool over one or many datasets."""
117117 if len (datasets ) == 0 :
118118 raise ConfigurationError ("Cannot create read tool: no datasets provided." )
@@ -165,7 +165,7 @@ async def read_func(
165165 sort_ascending = sort_ascending ,
166166 )
167167
168- return SystemToolDefinition (
168+ return SystemTool (
169169 name = tool_name ,
170170 description = tool_description ,
171171 func = read_func ,
@@ -179,7 +179,7 @@ def _auto_generate_search_summary_tool(
179179 session : Session ,
180180 tool_name : str ,
181181 tool_description : str ,
182- ) -> SystemToolDefinition :
182+ ) -> SystemTool :
183183 """Create a grep-like summary tool over one or many datasets (string columns)."""
184184 if len (datasets ) == 0 :
185185 raise ValueError ("Cannot create search summary tool: no datasets provided." )
@@ -205,7 +205,7 @@ async def search_summary(
205205 pl_df = pl .DataFrame (rows )
206206 return InMemorySource .from_session_state (pl_df , session ._session_state )
207207
208- return SystemToolDefinition (
208+ return SystemTool (
209209 name = tool_name ,
210210 description = tool_description ,
211211 func = search_summary ,
@@ -220,7 +220,7 @@ def _auto_generate_search_content_tool(
220220 tool_description : str ,
221221 * ,
222222 result_limit : int = 100 ,
223- ) -> SystemToolDefinition :
223+ ) -> SystemTool :
224224 """Create a content search tool for a single dataset (string columns)."""
225225 if len (datasets ) == 0 :
226226 raise ValidationError ("Cannot create search content tool: no datasets provided." )
@@ -276,7 +276,7 @@ async def search_rows(
276276 sort_ascending = sort_ascending ,
277277 )
278278
279- return SystemToolDefinition (
279+ return SystemTool (
280280 name = tool_name ,
281281 description = tool_description ,
282282 func = search_rows ,
@@ -290,7 +290,7 @@ def _auto_generate_schema_tool(
290290 session : Session ,
291291 tool_name : str ,
292292 tool_description : str ,
293- ) -> SystemToolDefinition :
293+ ) -> SystemTool :
294294 """Create a schema tool over one or many datasets.
295295
296296 - Returns one row per dataset with a column `schema` containing a list of
@@ -337,7 +337,7 @@ async def schema_func(
337337 session ._session_state ,
338338 )
339339
340- return SystemToolDefinition (
340+ return SystemTool (
341341 name = tool_name ,
342342 description = tool_description .strip (),
343343 func = schema_func ,
@@ -352,7 +352,7 @@ def _auto_generate_sql_tool(
352352 tool_description : str ,
353353 * ,
354354 result_limit : int = 100 ,
355- ) -> SystemToolDefinition :
355+ ) -> SystemTool :
356356 """Create an Analyze tool that executes DuckDB SELECT SQL across datasets.
357357
358358 - JOINs between the provided datasets are allowed.
@@ -389,7 +389,7 @@ async def analyze_func(
389389 )
390390 enhanced_description = "\n " .join (lines )
391391
392- tool = SystemToolDefinition (
392+ tool = SystemTool (
393393 name = tool_name ,
394394 description = enhanced_description ,
395395 func = analyze_func ,
@@ -485,7 +485,7 @@ def _auto_generate_profile_tool(
485485 tool_description : str ,
486486 * ,
487487 topk_distinct : int = 10 ,
488- ) -> SystemToolDefinition :
488+ ) -> SystemTool :
489489 """Create a cached Profile tool for one or many datasets.
490490
491491 Output columns include:
@@ -525,7 +525,7 @@ async def profile_func(
525525
526526 return profile_df ._logical_plan
527527
528- return SystemToolDefinition (
528+ return SystemTool (
529529 name = tool_name ,
530530 description = tool_description ,
531531 func = profile_func ,
@@ -700,7 +700,7 @@ def _auto_generate_system_tools(
700700 * ,
701701 tool_group_name : str ,
702702 max_result_limit : int = 100 ,
703- ) -> List [SystemToolDefinition ]:
703+ ) -> List [SystemTool ]:
704704 """Generate core tools spanning all datasets: Schema, Profile, Analyze.
705705
706706 - Schema: list columns/types for any or all datasets
0 commit comments