Skip to content

Commit c28436d

Browse files
committed
refactor(tools): rename meta tools to utility tools with tool_* prefix
Rename tool naming convention to avoid confusion with Facebook's Meta brand. The "meta_*" prefix was ambiguous and could be misinterpreted. File renames: - stackone_ai/meta_tools.py -> stackone_ai/utility_tools.py - tests/test_meta_tools.py -> tests/test_utility_tools.py - examples/meta_tools_example.py -> examples/utility_tools_example.py Tool name changes: - meta_search_tools -> tool_search - meta_execute_tool -> tool_execute - meta_collect_tool_feedback -> tool_feedback API changes: - Tools.meta_tools() -> Tools.utility_tools() Internal class renames: - MetaToolSearchResult -> ToolSearchResult - create_meta_search_tools() -> create_tool_search() - create_meta_execute_tool() -> create_tool_execute() - MetaSearchTool -> ToolSearchTool - MetaExecuteTool -> ToolExecuteTool All tests pass and documentation has been updated accordingly.
1 parent 2612ed3 commit c28436d

8 files changed

Lines changed: 116 additions & 116 deletions

File tree

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -281,16 +281,16 @@ result = crew.kickoff()
281281

282282
## Feedback Collection
283283

284-
The SDK includes a feedback collection tool (`meta_collect_tool_feedback`) that allows users to submit feedback about their experience with StackOne tools. This tool is automatically included in the toolset and is designed to be invoked by AI agents after user permission.
284+
The SDK includes a feedback collection tool (`tool_feedback`) that allows users to submit feedback about their experience with StackOne tools. This tool is automatically included in the toolset and is designed to be invoked by AI agents after user permission.
285285

286286
```python
287287
from stackone_ai import StackOneToolSet
288288

289289
toolset = StackOneToolSet()
290290

291-
# Get the feedback tool (included with "meta_*" pattern or all tools)
292-
tools = toolset.fetch_tools(actions=["meta_*"])
293-
feedback_tool = tools.get_tool("meta_collect_tool_feedback")
291+
# Get the feedback tool (included with "tool_*" pattern or all tools)
292+
tools = toolset.fetch_tools(actions=["tool_*"])
293+
feedback_tool = tools.get_tool("tool_feedback")
294294

295295
# Submit feedback (typically invoked by AI after user consent)
296296
result = feedback_tool.call(
@@ -305,23 +305,23 @@ result = feedback_tool.call(
305305
- "Are you ok with sending feedback to StackOne? The LLM will take care of sending it."
306306
- Only call the tool after the user explicitly agrees.
307307

308-
## Meta Tools (Beta)
308+
## Utility Tools (Beta)
309309

310-
Meta tools enable dynamic tool discovery and execution without hardcoding tool names.
310+
Utility tools enable dynamic tool discovery and execution without hardcoding tool names.
311311

312312
### Basic Usage
313313

314314
```python
315-
# Get meta tools for dynamic discovery
315+
# Get utility tools for dynamic discovery
316316
tools = toolset.fetch_tools(actions=["hris_*"])
317-
meta_tools = tools.meta_tools()
317+
utility_tools = tools.utility_tools()
318318

319319
# Search for relevant tools using natural language
320-
filter_tool = meta_tools.get_tool("meta_search_tools")
320+
filter_tool = utility_tools.get_tool("tool_search")
321321
results = filter_tool.call(query="manage employees", limit=5)
322322

323323
# Execute discovered tools dynamically
324-
execute_tool = meta_tools.get_tool("meta_execute_tool")
324+
execute_tool = utility_tools.get_tool("tool_execute")
325325
result = execute_tool.call(toolName="hris_list_employees", params={"limit": 10})
326326
```
327327

@@ -334,7 +334,7 @@ For more examples, check out the [examples/](examples/) directory:
334334
- [OpenAI Integration](examples/openai_integration.py)
335335
- [LangChain Integration](examples/langchain_integration.py)
336336
- [CrewAI Integration](examples/crewai_integration.py)
337-
- [Meta Tools](examples/meta_tools_example.py)
337+
- [Utility Tools](examples/utility_tools_example.py)
338338

339339
## Development
340340

examples/test_examples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def get_example_files() -> list[str]:
3030
"index.py": ["mcp"],
3131
"file_uploads.py": ["mcp"],
3232
"stackone_account_ids.py": ["mcp"],
33-
"meta_tools_example.py": ["mcp"],
33+
"utility_tools_example.py": ["mcp"],
3434
"mcp_server.py": ["mcp"],
3535
}
3636

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env python
22
"""
3-
Example demonstrating meta tools for dynamic tool discovery and execution.
3+
Example demonstrating utility tools for dynamic tool discovery and execution.
44
5-
Meta tools allow AI agents to search for relevant tools based on natural language queries
5+
Utility tools allow AI agents to search for relevant tools based on natural language queries
66
and execute them dynamically without hardcoding tool names.
77
"""
88

@@ -16,8 +16,8 @@
1616
load_dotenv()
1717

1818

19-
def example_meta_tools_basic():
20-
"""Basic example of using meta tools for tool discovery"""
19+
def example_utility_tools_basic():
20+
"""Basic example of using utility tools for tool discovery"""
2121
print("Example 1: Dynamic tool discovery\n")
2222

2323
# Initialize StackOne toolset
@@ -27,11 +27,11 @@ def example_meta_tools_basic():
2727
all_tools = toolset.fetch_tools(actions=["bamboohr_*"])
2828
print(f"Total BambooHR tools available: {len(all_tools)}")
2929

30-
# Get meta tools for dynamic discovery
31-
meta_tools = all_tools.meta_tools()
30+
# Get utility tools for dynamic discovery
31+
utility_tools = all_tools.utility_tools()
3232

3333
# Get the filter tool to search for relevant tools
34-
filter_tool = meta_tools.get_tool("meta_search_tools")
34+
filter_tool = utility_tools.get_tool("tool_search")
3535
if filter_tool:
3636
# Search for employee management tools
3737
result = filter_tool.call(query="manage employees create update list", limit=5, minScore=0.0)
@@ -43,7 +43,7 @@ def example_meta_tools_basic():
4343
print()
4444

4545

46-
def example_meta_tools_with_execution():
46+
def example_utility_tools_with_execution():
4747
"""Example of discovering and executing tools dynamically"""
4848
print("Example 2: Dynamic tool execution\n")
4949

@@ -52,11 +52,11 @@ def example_meta_tools_with_execution():
5252

5353
# Get all tools using MCP-backed fetch_tools()
5454
all_tools = toolset.fetch_tools()
55-
meta_tools = all_tools.meta_tools()
55+
utility_tools = all_tools.utility_tools()
5656

5757
# Step 1: Search for relevant tools
58-
filter_tool = meta_tools.get_tool("meta_search_tools")
59-
execute_tool = meta_tools.get_tool("meta_execute_tool")
58+
filter_tool = utility_tools.get_tool("tool_search")
59+
execute_tool = utility_tools.get_tool("tool_execute")
6060

6161
if filter_tool and execute_tool:
6262
# Find tools for listing employees
@@ -81,8 +81,8 @@ def example_meta_tools_with_execution():
8181

8282

8383
def example_with_openai():
84-
"""Example of using meta tools with OpenAI"""
85-
print("Example 3: Using meta tools with OpenAI\n")
84+
"""Example of using utility tools with OpenAI"""
85+
print("Example 3: Using utility tools with OpenAI\n")
8686

8787
try:
8888
from openai import OpenAI
@@ -93,20 +93,20 @@ def example_with_openai():
9393
# Initialize StackOne toolset
9494
toolset = StackOneToolSet()
9595

96-
# Get BambooHR tools and their meta tools using MCP-backed fetch_tools()
96+
# Get BambooHR tools and their utility tools using MCP-backed fetch_tools()
9797
bamboohr_tools = toolset.fetch_tools(actions=["bamboohr_*"])
98-
meta_tools = bamboohr_tools.meta_tools()
98+
utility_tools = bamboohr_tools.utility_tools()
9999

100100
# Convert to OpenAI format
101-
openai_tools = meta_tools.to_openai()
101+
openai_tools = utility_tools.to_openai()
102102

103-
# Create a chat completion with meta tools
103+
# Create a chat completion with utility tools
104104
response = client.chat.completions.create(
105105
model="gpt-4",
106106
messages=[
107107
{
108108
"role": "system",
109-
"content": "You are an HR assistant. Use meta_search_tools to find appropriate tools, then meta_execute_tool to execute them.",
109+
"content": "You are an HR assistant. Use tool_search to find appropriate tools, then tool_execute to execute them.",
110110
},
111111
{"role": "user", "content": "Can you help me find tools for managing employee records?"},
112112
],
@@ -145,12 +145,12 @@ def example_with_langchain():
145145
tools = toolset.fetch_tools(actions=["bamboohr_list_*"])
146146
langchain_tools = tools.to_langchain()
147147

148-
# Get meta tools as well
149-
meta_tools = tools.meta_tools()
150-
langchain_meta_tools = meta_tools.to_langchain()
148+
# Get utility tools as well
149+
utility_tools = tools.utility_tools()
150+
langchain_utility_tools = utility_tools.to_langchain()
151151

152152
# Combine all tools
153-
all_langchain_tools = list(langchain_tools) + list(langchain_meta_tools)
153+
all_langchain_tools = list(langchain_tools) + list(langchain_utility_tools)
154154

155155
print(f"Available tools for LangChain: {len(all_langchain_tools)}")
156156
for tool in all_langchain_tools:
@@ -163,7 +163,7 @@ def example_with_langchain():
163163
[
164164
(
165165
"system",
166-
"You are an HR assistant. Use the meta tools to discover and execute relevant tools.",
166+
"You are an HR assistant. Use the utility tools to discover and execute relevant tools.",
167167
),
168168
("human", "{input}"),
169169
("placeholder", "{agent_scratchpad}"),
@@ -190,13 +190,13 @@ def example_with_langchain():
190190
def main():
191191
"""Run all examples"""
192192
print("=" * 60)
193-
print("StackOne AI SDK - Meta Tools Examples")
193+
print("StackOne AI SDK - Utility Tools Examples")
194194
print("=" * 60)
195195
print()
196196

197197
# Basic examples that work without external APIs
198-
example_meta_tools_basic()
199-
example_meta_tools_with_execution()
198+
example_utility_tools_basic()
199+
example_utility_tools_with_execution()
200200

201201
# Examples that require OpenAI API
202202
if os.getenv("OPENAI_API_KEY"):

stackone_ai/feedback/tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def create_feedback_tool(
160160
Returns:
161161
FeedbackTool configured for feedback collection
162162
"""
163-
name = "meta_collect_tool_feedback"
163+
name = "tool_feedback"
164164
description = (
165165
"Collects user feedback on StackOne tool performance. "
166166
'First ask the user, "Are you ok with sending feedback to StackOne?" '

stackone_ai/models.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -530,10 +530,10 @@ def to_langchain(self) -> Sequence[BaseTool]:
530530
"""
531531
return [tool.to_langchain() for tool in self.tools]
532532

533-
def meta_tools(self, hybrid_alpha: float | None = None) -> Tools:
534-
"""Return meta tools for tool discovery and execution
533+
def utility_tools(self, hybrid_alpha: float | None = None) -> Tools:
534+
"""Return utility tools for tool discovery and execution
535535
536-
Meta tools enable dynamic tool discovery and execution based on natural language queries
536+
Utility tools enable dynamic tool discovery and execution based on natural language queries
537537
using hybrid BM25 + TF-IDF search.
538538
539539
Args:
@@ -543,22 +543,22 @@ def meta_tools(self, hybrid_alpha: float | None = None) -> Tools:
543543
(10.8% improvement in validation testing).
544544
545545
Returns:
546-
Tools collection containing meta_search_tools and meta_execute_tool
546+
Tools collection containing tool_search and tool_execute
547547
548548
Note:
549549
This feature is in beta and may change in future versions
550550
"""
551-
from stackone_ai.meta_tools import (
551+
from stackone_ai.utility_tools import (
552552
ToolIndex,
553-
create_meta_execute_tool,
554-
create_meta_search_tools,
553+
create_tool_execute,
554+
create_tool_search,
555555
)
556556

557557
# Create search index with hybrid search
558558
index = ToolIndex(self.tools, hybrid_alpha=hybrid_alpha)
559559

560-
# Create meta tools
561-
filter_tool = create_meta_search_tools(index)
562-
execute_tool = create_meta_execute_tool(self)
560+
# Create utility tools
561+
filter_tool = create_tool_search(index)
562+
execute_tool = create_tool_execute(self)
563563

564564
return Tools([filter_tool, execute_tool])

0 commit comments

Comments
 (0)