The StackOne SDK provides glob-based filtering capabilities to help you select and manage specific tools across different SaaS platforms.

Overview

Tool filtering allows you to:

  • Select tools by category (HRIS, ATS, etc.)
  • Filter by specific actions (create, read, update, delete)
  • Combine multiple patterns for precise selection
  • Exclude specific tools or patterns

Basic Filtering Patterns

import { StackOneToolSet } from '@stackone/ai';

const toolset = new StackOneToolSet();

// Get all HRIS tools
const hrisTools = toolset.getTools('hris_*');
// Get all ATS tools etc.
const atsTools = toolset.getStackOneTools('ats_*');

// Get all create operations
const createTools = toolset.getStackOneTools('*_create_*');

// Get all HRIS create operations
const hrisCreateTools = toolset.getStackOneTools('hris_create_*');

Advanced Filtering

1. Multiple Patterns

// Get both HRIS and ATS tools
const tools = toolset.getStackOneTools(['hris_*', 'ats_*']);

// Get specific operations across categories
const specificTools = toolset.getStackOneTools([
  'hris_create_employee',
  'ats_update_candidate',
  'crm_get_contact'
]);

Tool Categories

Common tool categories and their patterns:

const TOOL_CATEGORIES = {
  // HRIS Tools
  hris: {
    all: 'hris_*',
    employee: 'hris_*_employee*',
    document: 'hris_*_document*',
    payroll: 'hris_*_payroll*'
  },

  // ATS Tools
  ats: {
    all: 'ats_*',
    candidate: 'ats_*_candidate*',
    job: 'ats_*_job*',
    application: 'ats_*_application*'
  },

  // CRM Tools
  crm: {
    all: 'crm_*',
    contact: 'crm_*_contact*',
    deal: 'crm_*_deal*',
    company: 'crm_*_company*'
  }
};

Best Practices

  1. Be Specific: Use the most specific patterns that meet your needs
  2. Use Exclusions: Exclude patterns for better precision
  3. Group Related Tools: Use category-based filtering for related operations