datarobot-genai 0.2.23__tar.gz → 0.2.24__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/PKG-INFO +1 -1
  2. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/pyproject.toml +1 -1
  3. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/tools/predictive/training.py +160 -151
  4. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/.gitignore +0 -0
  5. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/AUTHORS +0 -0
  6. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/LICENSE +0 -0
  7. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/README.md +0 -0
  8. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/__init__.py +0 -0
  9. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/core/__init__.py +0 -0
  10. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/core/agents/__init__.py +0 -0
  11. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/core/agents/base.py +0 -0
  12. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/core/chat/__init__.py +0 -0
  13. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/core/chat/auth.py +0 -0
  14. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/core/chat/client.py +0 -0
  15. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/core/chat/responses.py +0 -0
  16. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/core/cli/__init__.py +0 -0
  17. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/core/cli/agent_environment.py +0 -0
  18. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/core/cli/agent_kernel.py +0 -0
  19. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/core/custom_model.py +0 -0
  20. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/core/mcp/__init__.py +0 -0
  21. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/core/mcp/common.py +0 -0
  22. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/core/telemetry_agent.py +0 -0
  23. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/core/utils/__init__.py +0 -0
  24. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/core/utils/auth.py +0 -0
  25. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/core/utils/urls.py +0 -0
  26. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/crewai/__init__.py +0 -0
  27. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/crewai/agent.py +0 -0
  28. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/crewai/base.py +0 -0
  29. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/crewai/events.py +0 -0
  30. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/crewai/mcp.py +0 -0
  31. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/__init__.py +0 -0
  32. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/__init__.py +0 -0
  33. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/auth.py +0 -0
  34. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/clients.py +0 -0
  35. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/config.py +0 -0
  36. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/config_utils.py +0 -0
  37. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/constants.py +0 -0
  38. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/credentials.py +0 -0
  39. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/dr_mcp_server.py +0 -0
  40. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/dr_mcp_server_logo.py +0 -0
  41. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/dynamic_prompts/__init__.py +0 -0
  42. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/dynamic_prompts/controllers.py +0 -0
  43. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/dynamic_prompts/dr_lib.py +0 -0
  44. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/dynamic_prompts/register.py +0 -0
  45. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/dynamic_prompts/utils.py +0 -0
  46. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/dynamic_tools/__init__.py +0 -0
  47. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/dynamic_tools/deployment/__init__.py +0 -0
  48. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/dynamic_tools/deployment/adapters/__init__.py +0 -0
  49. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/dynamic_tools/deployment/adapters/base.py +0 -0
  50. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/dynamic_tools/deployment/adapters/default.py +0 -0
  51. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/dynamic_tools/deployment/adapters/drum.py +0 -0
  52. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/dynamic_tools/deployment/config.py +0 -0
  53. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/dynamic_tools/deployment/controllers.py +0 -0
  54. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/dynamic_tools/deployment/metadata.py +0 -0
  55. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/dynamic_tools/deployment/register.py +0 -0
  56. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/dynamic_tools/deployment/schemas/drum_agentic_fallback_schema.json +0 -0
  57. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/dynamic_tools/deployment/schemas/drum_prediction_fallback_schema.json +0 -0
  58. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/dynamic_tools/register.py +0 -0
  59. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/dynamic_tools/schema.py +0 -0
  60. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/exceptions.py +0 -0
  61. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/logging.py +0 -0
  62. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/mcp_instance.py +0 -0
  63. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/mcp_server_tools.py +0 -0
  64. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/memory_management/__init__.py +0 -0
  65. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/memory_management/manager.py +0 -0
  66. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/memory_management/memory_tools.py +0 -0
  67. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/routes.py +0 -0
  68. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/routes_utils.py +0 -0
  69. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/server_life_cycle.py +0 -0
  70. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/telemetry.py +0 -0
  71. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/tool_config.py +0 -0
  72. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/tool_filter.py +0 -0
  73. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/core/utils.py +0 -0
  74. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/server.py +0 -0
  75. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/test_utils/__init__.py +0 -0
  76. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/test_utils/elicitation_test_tool.py +0 -0
  77. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/test_utils/integration_mcp_server.py +0 -0
  78. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/test_utils/mcp_utils_ete.py +0 -0
  79. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/test_utils/mcp_utils_integration.py +0 -0
  80. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/test_utils/openai_llm_mcp_client.py +0 -0
  81. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/test_utils/test_interactive.py +0 -0
  82. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/test_utils/tool_base_ete.py +0 -0
  83. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/test_utils/utils.py +0 -0
  84. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/tools/__init__.py +0 -0
  85. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/tools/clients/__init__.py +0 -0
  86. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/tools/clients/atlassian.py +0 -0
  87. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/tools/clients/confluence.py +0 -0
  88. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/tools/clients/gdrive.py +0 -0
  89. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/tools/clients/jira.py +0 -0
  90. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/tools/clients/s3.py +0 -0
  91. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/tools/confluence/__init__.py +0 -0
  92. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/tools/confluence/tools.py +0 -0
  93. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/tools/gdrive/__init__.py +0 -0
  94. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/tools/gdrive/tools.py +0 -0
  95. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/tools/jira/__init__.py +0 -0
  96. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/tools/jira/tools.py +0 -0
  97. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/tools/predictive/__init__.py +0 -0
  98. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/tools/predictive/data.py +0 -0
  99. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/tools/predictive/deployment.py +0 -0
  100. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/tools/predictive/deployment_info.py +0 -0
  101. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/tools/predictive/model.py +0 -0
  102. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/tools/predictive/predict.py +0 -0
  103. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/tools/predictive/predict_realtime.py +0 -0
  104. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/drmcp/tools/predictive/project.py +0 -0
  105. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/langgraph/__init__.py +0 -0
  106. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/langgraph/agent.py +0 -0
  107. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/langgraph/mcp.py +0 -0
  108. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/llama_index/__init__.py +0 -0
  109. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/llama_index/agent.py +0 -0
  110. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/llama_index/base.py +0 -0
  111. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/llama_index/mcp.py +0 -0
  112. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/nat/__init__.py +0 -0
  113. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/nat/agent.py +0 -0
  114. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/nat/datarobot_auth_provider.py +0 -0
  115. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/nat/datarobot_llm_clients.py +0 -0
  116. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/nat/datarobot_llm_providers.py +0 -0
  117. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/nat/datarobot_mcp_client.py +0 -0
  118. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/nat/helpers.py +0 -0
  119. {datarobot_genai-0.2.23 → datarobot_genai-0.2.24}/src/datarobot_genai/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datarobot-genai
3
- Version: 0.2.23
3
+ Version: 0.2.24
4
4
  Summary: Generic helpers for GenAI
5
5
  Project-URL: Homepage, https://github.com/datarobot-oss/datarobot-genai
6
6
  Author: DataRobot, Inc.
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "datarobot-genai"
7
- version = "0.2.23"
7
+ version = "0.2.24"
8
8
  description = "Generic helpers for GenAI"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10, <3.13"
@@ -18,8 +18,11 @@ import json
18
18
  import logging
19
19
  from dataclasses import asdict
20
20
  from dataclasses import dataclass
21
+ from typing import Annotated
21
22
 
22
23
  import pandas as pd
24
+ from fastmcp.exceptions import ToolError
25
+ from fastmcp.tools.tool import ToolResult
23
26
 
24
27
  from datarobot_genai.drmcp.core.clients import get_sdk_client
25
28
  from datarobot_genai.drmcp.core.mcp_instance import dr_mcp_tool
@@ -53,22 +56,15 @@ class DatasetInsight:
53
56
  missing_data_summary: dict[str, float]
54
57
 
55
58
 
56
- @dr_mcp_tool(tags={"training", "analysis", "dataset"})
57
- async def analyze_dataset(dataset_id: str) -> str:
58
- """
59
- Analyze a dataset to understand its structure and potential use cases.
59
+ @dr_mcp_tool(tags={"predictive", "training", "read", "analysis", "dataset"})
60
+ async def analyze_dataset(
61
+ *,
62
+ dataset_id: Annotated[str, "The ID of the DataRobot dataset to analyze"] | None = None,
63
+ ) -> ToolError | ToolResult:
64
+ """Analyze a dataset to understand its structure and potential use cases."""
65
+ if not dataset_id:
66
+ return ToolError("Dataset ID must be provided")
60
67
 
61
- Args:
62
- dataset_id: The ID of the DataRobot dataset to analyze
63
-
64
- Returns
65
- -------
66
- JSON string containing dataset insights including:
67
- - Basic statistics (rows, columns)
68
- - Column types (numerical, categorical, datetime, text)
69
- - Potential target columns
70
- - Missing data summary
71
- """
72
68
  client = get_sdk_client()
73
69
  dataset = client.Dataset.get(dataset_id)
74
70
  df = dataset.get_as_dataframe()
@@ -105,27 +101,23 @@ async def analyze_dataset(dataset_id: str) -> str:
105
101
  potential_targets=potential_targets,
106
102
  missing_data_summary=missing_data,
107
103
  )
104
+ insights_dict = asdict(insights)
108
105
 
109
- return json.dumps(asdict(insights), indent=2)
110
-
106
+ return ToolResult(
107
+ content=json.dumps(insights_dict, indent=2),
108
+ structured_content=insights_dict,
109
+ )
111
110
 
112
- @dr_mcp_tool(tags={"training", "analysis", "usecase"})
113
- async def suggest_use_cases(dataset_id: str) -> str:
114
- """
115
- Analyze a dataset and suggest potential machine learning use cases.
116
111
 
117
- Args:
118
- dataset_id: The ID of the DataRobot dataset to analyze
112
+ @dr_mcp_tool(tags={"predictive", "training", "read", "analysis", "usecase"})
113
+ async def suggest_use_cases(
114
+ *,
115
+ dataset_id: Annotated[str, "The ID of the DataRobot dataset to analyze"] | None = None,
116
+ ) -> ToolError | ToolResult:
117
+ """Analyze a dataset and suggest potential machine learning use cases."""
118
+ if not dataset_id:
119
+ return ToolError("Dataset ID must be provided")
119
120
 
120
- Returns
121
- -------
122
- JSON string containing suggested use cases with:
123
- - Use case name and description
124
- - Suggested target column
125
- - Problem type
126
- - Confidence score
127
- - Reasoning for the suggestion
128
- """
129
121
  client = get_sdk_client()
130
122
  dataset = client.Dataset.get(dataset_id)
131
123
  df = dataset.get_as_dataframe()
@@ -141,27 +133,23 @@ async def suggest_use_cases(dataset_id: str) -> str:
141
133
 
142
134
  # Sort by confidence score
143
135
  suggestions.sort(key=lambda x: x["confidence"], reverse=True)
144
- return json.dumps(suggestions, indent=2)
145
-
146
-
147
- @dr_mcp_tool(tags={"training", "analysis", "eda"})
148
- async def get_exploratory_insights(dataset_id: str, target_col: str | None = None) -> str:
149
- """
150
- Generate exploratory data insights for a dataset.
151
-
152
- Args:
153
- dataset_id: The ID of the DataRobot dataset to analyze
154
- target_col: Optional target column to focus EDA insights on
155
-
156
- Returns
157
- -------
158
- JSON string containing EDA insights including:
159
- - Dataset summary statistics
160
- - Target variable analysis (if specified)
161
- - Feature correlations with target
162
- - Missing data analysis
163
- - Data type distribution
164
- """
136
+
137
+ return ToolResult(
138
+ content=json.dumps(suggestions, indent=2),
139
+ structured_content={"use_case_suggestions": suggestions},
140
+ )
141
+
142
+
143
+ @dr_mcp_tool(tags={"predictive", "training", "read", "analysis", "eda"})
144
+ async def get_exploratory_insights(
145
+ *,
146
+ dataset_id: Annotated[str, "The ID of the DataRobot dataset to analyze"] | None = None,
147
+ target_col: Annotated[str, "Optional target column to focus EDA insights on"] | None = None,
148
+ ) -> ToolError | ToolResult:
149
+ """Generate exploratory data insights for a dataset."""
150
+ if not dataset_id:
151
+ return ToolError("Dataset ID must be provided")
152
+
165
153
  client = get_sdk_client()
166
154
  dataset = client.Dataset.get(dataset_id)
167
155
  df = dataset.get_as_dataframe()
@@ -238,8 +226,10 @@ async def get_exploratory_insights(dataset_id: str, target_col: str | None = Non
238
226
  sorted(correlations.items(), key=lambda x: abs(x[1]), reverse=True)
239
227
  )
240
228
 
241
- eda_insights["ui_panel"] = ["eda"]
242
- return json.dumps(eda_insights, indent=2)
229
+ return ToolResult(
230
+ content=json.dumps(eda_insights, indent=2),
231
+ structured_content=eda_insights,
232
+ )
243
233
 
244
234
 
245
235
  def _identify_potential_targets(
@@ -450,47 +440,50 @@ def _analyze_target_for_use_cases(df: pd.DataFrame, target_col: str) -> list[Use
450
440
  return suggestions
451
441
 
452
442
 
453
- @dr_mcp_tool(tags={"training", "autopilot", "model"})
443
+ @dr_mcp_tool(tags={"predictive", "training", "write", "autopilot", "model"})
454
444
  async def start_autopilot(
455
- target: str,
456
- project_id: str | None = None,
457
- mode: str | None = "quick",
458
- dataset_url: str | None = None,
459
- dataset_id: str | None = None,
460
- project_name: str | None = "MCP Project",
461
- use_case_id: str | None = None,
462
- ) -> str:
463
- """
464
- Start automated model training (Autopilot) for a project.
465
-
466
- Args:
467
- target: Name of the target column for modeling.
468
- project_id: Optional, the ID of the DataRobot project or a new project if no id is provided.
469
- mode: Optional, Autopilot mode ('quick', 'comprehensive', or 'manual')
470
- dataset_url: Optional, The URL to the dataset to upload (optional if dataset_id is provided)
471
- for a new project.
472
- dataset_id: Optional, The ID of an existing dataset in AI Catalog (optional if dataset_url
473
- is provided) for a new project.
474
- project_name: Optional, name for the project if no id is provided, creates a new project.
475
- use_case_id: Optional, ID of the use case to associate this project with (required for
476
- next-gen platform).
477
-
478
- Returns
479
- -------
480
- JSON string containing:
481
- - project_id: Project ID
482
- - target: Target column name
483
- - mode: Selected Autopilot mode
484
- - status: Current project status
485
- - ui_panel: List of recommended UI panels for visualization
486
- """
445
+ *,
446
+ target: Annotated[str, "Name of the target column for modeling"] | None = None,
447
+ project_id: Annotated[
448
+ str, "Optional, the ID of the DataRobot project or a new project if no id is provided"
449
+ ]
450
+ | None = None,
451
+ mode: Annotated[str, "Optional, Autopilot mode ('quick', 'comprehensive', or 'manual')"]
452
+ | None = "quick",
453
+ dataset_url: Annotated[
454
+ str,
455
+ """
456
+ Optional, The URL to the dataset to upload
457
+ (optional if dataset_id is provided) for a new project.
458
+ """,
459
+ ]
460
+ | None = None,
461
+ dataset_id: Annotated[
462
+ str,
463
+ """
464
+ Optional, The ID of an existing dataset in AI Catalog
465
+ (optional if dataset_url is provided) for a new project.
466
+ """,
467
+ ]
468
+ | None = None,
469
+ project_name: Annotated[
470
+ str, "Optional, name for the project if no id is provided, creates a new project"
471
+ ]
472
+ | None = "MCP Project",
473
+ use_case_id: Annotated[
474
+ str,
475
+ "Optional, ID of the use case to associate this project (required for next-gen platform)",
476
+ ]
477
+ | None = None,
478
+ ) -> ToolError | ToolResult:
479
+ """Start automated model training (Autopilot) for a project."""
487
480
  client = get_sdk_client()
488
481
 
489
482
  if not project_id:
490
483
  if not dataset_url and not dataset_id:
491
- return "Error: Either dataset_url or dataset_id must be provided"
484
+ return ToolError("Either dataset_url or dataset_id must be provided")
492
485
  if dataset_url and dataset_id:
493
- return "Error: Please provide either dataset_url or dataset_id, not both"
486
+ return ToolError("Please provide either dataset_url or dataset_id, not both")
494
487
 
495
488
  if dataset_url:
496
489
  dataset = client.Dataset.create_from_url(dataset_url)
@@ -504,7 +497,7 @@ async def start_autopilot(
504
497
  project = client.Project.get(project_id)
505
498
 
506
499
  if not target:
507
- return "Error: Target variable must be specified"
500
+ return ToolError("Target variable must be specified")
508
501
 
509
502
  try:
510
503
  # Start modeling
@@ -515,40 +508,48 @@ async def start_autopilot(
515
508
  "target": target,
516
509
  "mode": mode,
517
510
  "status": project.get_status(),
518
- "ui_panel": ["eda", "model-training", "leaderboard"],
519
511
  "use_case_id": project.use_case_id,
520
512
  }
521
513
 
522
- return json.dumps(result, indent=2)
523
- except Exception as e:
524
- return json.dumps(
525
- {
526
- "error": f"Failed to start Autopilot: {str(e)}",
527
- "project_id": project.id,
528
- "target": target,
529
- "mode": mode,
530
- },
531
- indent=2,
514
+ return ToolResult(
515
+ content=json.dumps(result, indent=2),
516
+ structured_content=result,
532
517
  )
533
518
 
519
+ except Exception as e:
520
+ return ToolError(
521
+ content=json.dumps(
522
+ {
523
+ "error": f"Failed to start Autopilot: {str(e)}",
524
+ "project_id": project.id if project else None,
525
+ "target": target,
526
+ "mode": mode,
527
+ },
528
+ indent=2,
529
+ )
530
+ )
534
531
 
535
- @dr_mcp_tool(tags={"training", "model", "evaluation"})
536
- async def get_model_roc_curve(project_id: str, model_id: str, source: str = "validation") -> str:
537
- """
538
- Get detailed ROC curve for a specific model.
539
532
 
540
- Args:
541
- project_id: The ID of the DataRobot project
542
- model_id: The ID of the model to analyze
543
- source: The source of the data to use for the ROC curve ('validation' or 'holdout' or
544
- 'crossValidation')
533
+ @dr_mcp_tool(tags={"prediction", "training", "read", "model", "evaluation"})
534
+ async def get_model_roc_curve(
535
+ *,
536
+ project_id: Annotated[str, "The ID of the DataRobot project"] | None = None,
537
+ model_id: Annotated[str, "The ID of the model to analyze"] | None = None,
538
+ source: Annotated[
539
+ str,
540
+ """
541
+ The source of the data to use for the ROC curve
542
+ ('validation' or 'holdout' or 'crossValidation')
543
+ """,
544
+ ]
545
+ | str = "validation",
546
+ ) -> ToolError | ToolResult:
547
+ """Get detailed ROC curve for a specific model."""
548
+ if not project_id:
549
+ return ToolError("Project ID must be provided")
550
+ if not model_id:
551
+ return ToolError("Model ID must be provided")
545
552
 
546
- Returns
547
- -------
548
- JSON string containing:
549
- - roc_curve: ROC curve data
550
- - ui_panel: List of recommended UI panels for visualization
551
- """
552
553
  client = get_sdk_client()
553
554
  project = client.Project.get(project_id)
554
555
  model = client.Model.get(project=project, model_id=model_id)
@@ -581,26 +582,26 @@ async def get_model_roc_curve(project_id: str, model_id: str, source: str = "val
581
582
  "source": source,
582
583
  }
583
584
 
584
- return json.dumps({"data": roc_data, "ui_panel": ["roc-curve"]}, indent=2)
585
+ return ToolResult(
586
+ content=json.dumps({"data": roc_data}, indent=2),
587
+ structured_content={"data": roc_data},
588
+ )
585
589
  except Exception as e:
586
- return json.dumps({"error": f"Failed to get ROC curve: {str(e)}"}, indent=2)
590
+ return ToolError(f"Failed to get ROC curve: {str(e)}")
587
591
 
588
592
 
589
- @dr_mcp_tool(tags={"training", "model", "evaluation"})
590
- async def get_model_feature_impact(project_id: str, model_id: str) -> str:
591
- """
592
- Get detailed feature impact for a specific model.
593
-
594
- Args:
595
- project_id: The ID of the DataRobot project
596
- model_id: The ID of the model to analyze
593
+ @dr_mcp_tool(tags={"predictive", "training", "read", "model", "evaluation"})
594
+ async def get_model_feature_impact(
595
+ *,
596
+ project_id: Annotated[str, "The ID of the DataRobot project"] | None = None,
597
+ model_id: Annotated[str, "The ID of the model to analyze"] | None = None,
598
+ ) -> ToolError | ToolResult:
599
+ """Get detailed feature impact for a specific model."""
600
+ if not project_id:
601
+ return ToolError("Project ID must be provided")
602
+ if not model_id:
603
+ return ToolError("Model ID must be provided")
597
604
 
598
- Returns
599
- -------
600
- JSON string containing:
601
- - feature_impact: Feature importance scores
602
- - ui_panel: List of recommended UI panels for visualization
603
- """
604
605
  client = get_sdk_client()
605
606
  project = client.Project.get(project_id)
606
607
  model = client.Model.get(project=project, model_id=model_id)
@@ -608,26 +609,31 @@ async def get_model_feature_impact(project_id: str, model_id: str) -> str:
608
609
  model.request_feature_impact()
609
610
  feature_impact = model.get_or_request_feature_impact()
610
611
 
611
- return json.dumps({"data": feature_impact, "ui_panel": ["feature-impact"]}, indent=2)
612
-
612
+ return ToolResult(
613
+ content=json.dumps({"data": feature_impact}, indent=2),
614
+ structured_content={"data": feature_impact},
615
+ )
613
616
 
614
- @dr_mcp_tool(tags={"training", "model", "evaluation"})
615
- async def get_model_lift_chart(project_id: str, model_id: str, source: str = "validation") -> str:
616
- """
617
- Get detailed lift chart for a specific model.
618
617
 
619
- Args:
620
- project_id: The ID of the DataRobot project
621
- model_id: The ID of the model to analyze
622
- source: The source of the data to use for the lift chart ('validation' or 'holdout' or
623
- 'crossValidation')
618
+ @dr_mcp_tool(tags={"predictive", "training", "read", "model", "evaluation"})
619
+ async def get_model_lift_chart(
620
+ project_id: Annotated[str, "The ID of the DataRobot project"] | None = None,
621
+ model_id: Annotated[str, "The ID of the model to analyze"] | None = None,
622
+ source: Annotated[
623
+ str,
624
+ """
625
+ The source of the data to use for the lift chart
626
+ ('validation' or 'holdout' or 'crossValidation')
627
+ """,
628
+ ]
629
+ | str = "validation",
630
+ ) -> ToolError | ToolResult:
631
+ """Get detailed lift chart for a specific model."""
632
+ if not project_id:
633
+ return ToolError("Project ID must be provided")
634
+ if not model_id:
635
+ return ToolError("Model ID must be provided")
624
636
 
625
- Returns
626
- -------
627
- JSON string containing:
628
- - lift_chart: Lift chart data
629
- - ui_panel: List of recommended UI panels for visualization
630
- """
631
637
  client = get_sdk_client()
632
638
  project = client.Project.get(project_id)
633
639
  model = client.Model.get(project=project, model_id=model_id)
@@ -648,4 +654,7 @@ async def get_model_lift_chart(project_id: str, model_id: str, source: str = "va
648
654
  "target_class": lift_chart.target_class,
649
655
  }
650
656
 
651
- return json.dumps({"data": lift_chart_data, "ui_panel": ["lift-chart"]}, indent=2)
657
+ return ToolResult(
658
+ content=json.dumps({"data": lift_chart_data}, indent=2),
659
+ structured_content={"data": lift_chart_data},
660
+ )