Initialise the ToolSet
Start by creating a StackOneToolSet instance. The SDK automatically readsSTACKONE_API_KEY, so you typically only provide fallback account IDs or custom HTTP settings:
Fetch Tools
Usefetch_tools() to dynamically load tools from StackOne’s MCP endpoint with glob patterns:
fetch_tools() pulls tool definitions at runtime based on your account IDs, reusing the credentials you already configured (e.g., via STACKONE_API_KEY). This is useful for multi-tenant applications where each customer has different integrations connected.
Advanced Filtering & Multi-Tenant
Advanced Filtering & Multi-Tenant
You can filter tools by account IDs, providers, and action patterns:This is useful when you want to:
- Limit tools to specific linked accounts
- Focus on specific providers
- Get only certain types of operations (e.g., all “list” operations)
Dynamic Account Handling
Dynamic Account Handling
Execute Tools
Basic Tool Execution
Alternative Execution Methods
Alternative Execution Methods
Attaching Session Context
Attaching Session Context
Both execution styles accept an optional
options keyword to pass metadata that is not forwarded to the StackOne API. The Python SDK uses this to power telemetry features such as LangSmith implicit feedback streams:Error Handling
Error Handling
Tool Search
Discover relevant tools at runtime using natural language queries:Environment Configuration
Using Environment Variables
Using Environment Variables
Using python-dotenv
Using python-dotenv
Implicit Feedback
LangSmith Integration
LangSmith Integration
The SDK can emit implicit behavioural signals to LangSmith whenever a tool is executed. Provide a LangSmith API key and optional overrides via environment variables:
Example
Next Steps
- Build LangChain agents for sophisticated workflows
- Create multi-agent systems with CrewAI
- Use with OpenAI for function calling
- Explore Tool Search for natural language tool discovery