Initialize the ToolSet

Start by creating a StackOneToolSet instance:
import { StackOneToolSet } from '@stackone/ai';

// Initialize the toolset
const toolset = new StackOneToolSet();
const accountId = 'your-customer-account-id';

Get Tools

Use glob patterns to retrieve specific tools:
// Get all HRIS tools
const hrisTools = toolset.getStackOneTools('hris_*', accountId);

// Get all ATS tools
const atsTools = toolset.getStackOneTools('ats_*', accountId);

// Get specific list operations
const listTools = toolset.getStackOneTools('hris_list_*', accountId);

Execute Tools

Basic Tool Execution

// Get a specific tool
const employeeTool = tools.getTool('hris_list_employees');

// Execute with parameters
const employees = await employeeTool.execute({
  limit: 10,
  include_details: true
});

console.log(employees);

Tool Filtering

Advanced Filtering Patterns

// Get all tools for multiple categories
const allTools = toolset.getStackOneTools(['hris_*', 'ats_*'], accountId);

// Exclude dangerous operations
const safeTools = toolset.getStackOneTools(['hris_*', '!hris_delete_*'], accountId);

// Get only read operations
const readOnlyTools = toolset.getStackOneTools(['*_list_*', '*_get_*'], accountId);

List Available Tools

// Get all available tools
const tools = toolset.getStackOneTools('*', accountId);
console.log('Tools:', tools.toArray())

Environment Configuration

Using Environment Variables

// Set in your .env file
// STACKONE_API_KEY=your_api_key
// STACKONE_ACCOUNT_ID=your_account_id

const toolset = new StackOneToolSet({
  apiKey: process.env.STACKONE_API_KEY,
  // accountId can still be passed per operation
});

Next Steps