Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
b0d8536
feat: add feedback tool to StackOne toolset
NicolasBelissent Sep 29, 2025
59b7ac7
improve desc
NicolasBelissent Sep 29, 2025
5d25dd9
adding better duration
NicolasBelissent Sep 29, 2025
f3cc7e1
Merge branch 'main' into feature/feedback-tool-feedback-consent
NicolasBelissent Sep 29, 2025
8563f5b
lint fix
NicolasBelissent Sep 29, 2025
2e0e267
refactor: streamline tool name normalization in feedback tool
NicolasBelissent Sep 29, 2025
5c29a4c
format
NicolasBelissent Sep 29, 2025
b1e6088
removing useless heuristics
NicolasBelissent Sep 29, 2025
83b4df9
fix: update feedback tool to use snake_case field names
NicolasBelissent Oct 14, 2025
b870cc5
chore: remove unused langsmith dependency
NicolasBelissent Oct 15, 2025
5bd2e8a
Merge branch 'main' into feature/feedback-tool-feedback-consent
NicolasBelissent Oct 16, 2025
4ea3683
feat: update feedback tool to match Python SDK structure
NicolasBelissent Oct 16, 2025
a823649
chore: remove outdated test directory and README
NicolasBelissent Oct 16, 2025
aef0970
docs: add feedback collection tool documentation to README
NicolasBelissent Oct 16, 2025
64032e1
style: apply consistent quote formatting to README
NicolasBelissent Oct 16, 2025
18a0d3f
feat: add multiple account ID support to feedback tool
NicolasBelissent Oct 17, 2025
84dd7fb
feat: align feedback tool response format with Python SDK
NicolasBelissent Oct 17, 2025
0116e9b
fix: resolve linting warnings in feedback tests
NicolasBelissent Oct 17, 2025
85cafd9
refactor: implement Python SDK test structure for feedback tool
NicolasBelissent Oct 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 119 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
> A unified interface for performing actions on SaaS tools through AI-friendly APIs.

[![DeepWiki](https://img.shields.io/badge/DeepWiki-StackOneHQ%2Fstackone--ai--node-blue.sv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vupy3q8TFn3Hos2IAk4Ju5dCo8B3wP7VPr/FGaKiG+T+v+TQqIrOqMTL1VdWV1DdmcbO8KXBz6esmYWYKPwDL5b5FA1a0hwapHiom0r/cKaoqr+27/XcrS5UwSMbQAAAABJRU5ErkJggg==)](https://deepwiki.com/StackOneHQ/stackone-ai-node)

<!-- DeepWiki badge generated by https://deepwiki.ryoppippi.com/ -->

## Toolsets
Expand Down Expand Up @@ -146,11 +147,11 @@ Call `fetchTools()` when you want the SDK to pull the current tool definitions d

```typescript
const toolset = new StackOneToolSet({
baseUrl: 'https://api.stackone.com',
baseUrl: "https://api.stackone.com",
});

const tools = await toolset.fetchTools();
const employeeTool = tools.getTool('hris_list_employees');
const employeeTool = tools.getTool("hris_list_employees");

const result = await employeeTool?.execute({
query: { limit: 5 },
Expand All @@ -165,31 +166,34 @@ You can filter tools by account IDs, providers, and action patterns:

```typescript
// Filter by account IDs
toolset.setAccounts(['account-123', 'account-456']);
toolset.setAccounts(["account-123", "account-456"]);
const tools = await toolset.fetchTools();
// OR
const tools = await toolset.fetchTools({ accountIds: ['account-123', 'account-456'] });
const tools = await toolset.fetchTools({
accountIds: ["account-123", "account-456"],
});

// Filter by providers
const tools = await toolset.fetchTools({ providers: ['hibob', 'bamboohr'] });
const tools = await toolset.fetchTools({ providers: ["hibob", "bamboohr"] });

// Filter by actions with exact match
const tools = await toolset.fetchTools({
actions: ['hibob_list_employees', 'hibob_create_employees']
actions: ["hibob_list_employees", "hibob_create_employees"],
});

// Filter by actions with glob patterns
const tools = await toolset.fetchTools({ actions: ['*_list_employees'] });
const tools = await toolset.fetchTools({ actions: ["*_list_employees"] });

// Combine multiple filters
const tools = await toolset.fetchTools({
accountIds: ['account-123'],
providers: ['hibob'],
actions: ['*_list_*']
accountIds: ["account-123"],
providers: ["hibob"],
actions: ["*_list_*"],
});
```

This is especially useful when you want to:

- Limit tools to specific linked accounts
- Focus on specific HR/CRM/ATS providers
- Get only certain types of operations (e.g., all "list" operations)
Expand Down Expand Up @@ -295,6 +299,110 @@ const toolsetWithHeaders = new OpenAPIToolSet({

These are some of the features which you can use with the OpenAPIToolSet and StackOneToolSet.

### Feedback Collection Tool

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 in the `StackOneToolSet` and helps improve the SDK based on user input.

#### How It Works

The feedback tool:

- **Requires explicit user consent** before submitting feedback
- **Collects user feedback** about their experience with StackOne tools
- **Tracks tool usage** by recording which tools were used
- **Submits to StackOne** via the `/ai/tool-feedback` endpoint
- **Uses the same API key** as other SDK operations for authentication

#### Usage

The feedback tool is automatically available when using `StackOneToolSet`:

```typescript
import { StackOneToolSet } from "@stackone/ai";

const toolset = new StackOneToolSet();
const tools = toolset.getTools("*", "account-id");

// The feedback tool is automatically included
const feedbackTool = tools.getTool("meta_collect_tool_feedback");

// Use with AI agents - they will ask for user consent first
const openAITools = tools.toOpenAI();
// or
const aiSdkTools = await tools.toAISDK();
```

#### Manual Usage

You can also use the feedback tool directly:

```typescript
// Get the feedback tool
const feedbackTool = tools.getTool("meta_collect_tool_feedback");

// Submit feedback (after getting user consent)
const result = await feedbackTool.execute({
feedback: "The tools worked great! Very easy to use.",
account_id: "acc_123456",
tool_names: ["hris_list_employees", "hris_create_time_off"],
});
```

#### Multiple Account Support

The feedback tool supports both single and multiple account IDs. When you provide an array of account IDs, the feedback will be sent to each account individually:

```typescript
// Single account ID (string)
await feedbackTool.execute({
feedback: "The tools worked great! Very easy to use.",
account_id: "acc_123456",
tool_names: ["hris_list_employees", "hris_create_time_off"],
});

// Multiple account IDs (array)
await feedbackTool.execute({
feedback: "The tools worked great! Very easy to use.",
account_id: ["acc_123456", "acc_789012"],
tool_names: ["hris_list_employees", "hris_create_time_off"],
});
```

**Response Format**: When using multiple account IDs, the tool returns a summary of all submissions:

```typescript
{
message: "Feedback sent to 2 account(s)",
total_accounts: 2,
successful: 2,
failed: 0,
results: [
{
account_id: "acc_123456",
status: "success",
result: { message: "Feedback successfully stored", ... }
},
{
account_id: "acc_789012",
status: "success",
result: { message: "Feedback successfully stored", ... }
}
]
}
```

#### AI Agent Integration

When AI agents use this tool, they will:

1. **Ask for user consent**: "Are you ok with sending feedback to StackOne?"
2. **Collect feedback**: Get the user's verbatim feedback
3. **Track tool usage**: Record which tools were used in the session
4. **Submit to all accounts**: Send the same feedback to each account ID provided
5. **Report results**: Show which accounts received the feedback successfully

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

### Meta Tools (Beta)

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.
Expand All @@ -304,6 +412,7 @@ Meta tools enable dynamic tool discovery and execution, allowing AI agents to se
#### How Meta Tools Work

Meta tools provide two core capabilities:

1. **Tool Discovery** (`meta_search_tools`): Search for tools using natural language queries
2. **Tool Execution** (`meta_execute_tool`): Execute discovered tools dynamically

Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
export * as OpenAPILoader from './openapi/loader';
export { OpenAPIParser } from './openapi/parser';
export { BaseTool, StackOneTool, Tools } from './tool';
export { createFeedbackTool } from './tools/feedback';
export { StackOneAPIError, StackOneError } from './utils/errors';

export {
Expand Down
Loading
Loading