Skip to content

Commit 46933a6

Browse files
committed
docs: promote Meta Tools to main feature and reorder Features section
- Move Meta Tools section to the top of Features - Remove beta label and warning from Meta Tools - Move Feedback Collection Tool below Meta Tools - Meta Tools is now a stable, main feature of the SDK
1 parent 53bce87 commit 46933a6

File tree

1 file changed

+70
-72
lines changed

1 file changed

+70
-72
lines changed

README.md

Lines changed: 70 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,76 @@ This is especially useful when you want to:
204204

205205
## Features
206206

207+
### Meta Tools
208+
209+
Meta tools enable dynamic tool discovery and execution, allowing AI agents to search for relevant tools based on natural language queries without hardcoding tool names.
210+
211+
#### How Meta Tools Work
212+
213+
Meta tools provide two core capabilities:
214+
215+
1. **Tool Discovery** (`meta_search_tools`): Search for tools using natural language queries
216+
2. **Tool Execution** (`meta_execute_tool`): Execute discovered tools dynamically
217+
218+
#### Basic Usage
219+
220+
```typescript
221+
import { StackOneToolSet } from "@stackone/ai";
222+
223+
const toolset = new StackOneToolSet({
224+
baseUrl: "https://api.stackone.com",
225+
});
226+
const tools = await toolset.fetchTools();
227+
228+
// Get meta tools for dynamic discovery
229+
const metaTools = await tools.metaTools();
230+
231+
// Use with OpenAI
232+
const openAITools = metaTools.toOpenAI();
233+
234+
// Use with AI SDK
235+
const aiSdkTools = await metaTools.toAISDK();
236+
```
237+
238+
#### Example: Dynamic Tool Discovery with AI SDK
239+
240+
```typescript
241+
import { generateText } from "ai";
242+
import { openai } from "@ai-sdk/openai";
243+
244+
const { text } = await generateText({
245+
model: openai("gpt-5.1"),
246+
tools: aiSdkTools,
247+
prompt: "Find tools for managing employees and create a time off request",
248+
maxSteps: 3, // Allow multiple tool calls
249+
});
250+
```
251+
252+
#### Direct Usage Without AI
253+
254+
```typescript
255+
// Step 1: Discover relevant tools
256+
const filterTool = metaTools.getTool("meta_search_tools");
257+
const searchResult = await filterTool.execute({
258+
query: "employee time off vacation",
259+
limit: 5,
260+
minScore: 0.3, // Minimum relevance score (0-1)
261+
});
262+
263+
// Step 2: Execute a discovered tool
264+
const executeTool = metaTools.getTool("meta_execute_tool");
265+
const result = await executeTool.execute({
266+
toolName: "hris_create_time_off",
267+
params: {
268+
employeeId: "emp_123",
269+
startDate: "2024-01-15",
270+
endDate: "2024-01-19",
271+
},
272+
});
273+
```
274+
275+
[View full example](examples/meta-tools.ts)
276+
207277
### Feedback Collection Tool
208278

209279
The StackOne AI SDK includes a built-in feedback collection tool (`meta_collect_tool_feedback`) that allows users to provide feedback on their experience with StackOne tools. This tool is automatically included when using `fetchTools()` and helps improve the SDK based on user input.
@@ -310,78 +380,6 @@ When AI agents use this tool, they will:
310380

311381
The tool description includes clear instructions for AI agents to always ask for explicit user consent before submitting feedback.
312382

313-
### Meta Tools (Beta)
314-
315-
Meta tools enable dynamic tool discovery and execution, allowing AI agents to search for relevant tools based on natural language queries without hardcoding tool names.
316-
317-
> ⚠️ **Beta Feature**: Meta tools are currently in beta and the API may change in future versions.
318-
319-
#### How Meta Tools Work
320-
321-
Meta tools provide two core capabilities:
322-
323-
1. **Tool Discovery** (`meta_search_tools`): Search for tools using natural language queries
324-
2. **Tool Execution** (`meta_execute_tool`): Execute discovered tools dynamically
325-
326-
#### Basic Usage
327-
328-
```typescript
329-
import { StackOneToolSet } from "@stackone/ai";
330-
331-
const toolset = new StackOneToolSet({
332-
baseUrl: "https://api.stackone.com",
333-
});
334-
const tools = await toolset.fetchTools();
335-
336-
// Get meta tools for dynamic discovery
337-
const metaTools = await tools.metaTools();
338-
339-
// Use with OpenAI
340-
const openAITools = metaTools.toOpenAI();
341-
342-
// Use with AI SDK
343-
const aiSdkTools = await metaTools.toAISDK();
344-
```
345-
346-
#### Example: Dynamic Tool Discovery with AI SDK
347-
348-
```typescript
349-
import { generateText } from "ai";
350-
import { openai } from "@ai-sdk/openai";
351-
352-
const { text } = await generateText({
353-
model: openai("gpt-5.1"),
354-
tools: aiSdkTools,
355-
prompt: "Find tools for managing employees and create a time off request",
356-
maxSteps: 3, // Allow multiple tool calls
357-
});
358-
```
359-
360-
#### Direct Usage Without AI
361-
362-
```typescript
363-
// Step 1: Discover relevant tools
364-
const filterTool = metaTools.getTool("meta_search_tools");
365-
const searchResult = await filterTool.execute({
366-
query: "employee time off vacation",
367-
limit: 5,
368-
minScore: 0.3, // Minimum relevance score (0-1)
369-
});
370-
371-
// Step 2: Execute a discovered tool
372-
const executeTool = metaTools.getTool("meta_execute_tool");
373-
const result = await executeTool.execute({
374-
toolName: "hris_create_time_off",
375-
params: {
376-
employeeId: "emp_123",
377-
startDate: "2024-01-15",
378-
endDate: "2024-01-19",
379-
},
380-
});
381-
```
382-
383-
[View full example](examples/meta-tools.ts)
384-
385383
### Custom Base URL
386384

387385
```typescript

0 commit comments

Comments
 (0)