Skip to main content
Build AI agents that can interact with business systems using OpenAI’s function calling atop StackOne’s infrastructure—thousands of ready-to-run tools exposed over RPC with unified MCP and A2A interfaces.

Overview

  • Function calling with business data access
  • Conversational agents with tool execution
  • Multi-step workflow automation
  • Real-time data integration
import json
from openai import OpenAI
from stackone_ai import StackOneToolSet

# Initialise clients
client = OpenAI()
toolset = StackOneToolSet()

# Fetch StackOne tools and convert to OpenAI format
tools = toolset.fetch_tools(
    actions=['bamboohr_get_employee', 'bamboohr_list_employees'],
    account_ids=['your-account-id']
)
openai_tools = tools.to_openai()

# Create an AI agent with tool access
response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[
        {
            "role": "system",
            "content": "You are an HR assistant with access to employee data."
        },
        {
            "role": "user",
            "content": "How many employees are in engineering?"
        }
    ],
    tools=openai_tools,
    tool_choice="auto"
)

# Handle tool calls
message = response.choices[0].message
if message.tool_calls:
    for tool_call in message.tool_calls:
        tool = tools.get_tool(tool_call.function.name)
        if tool:
            result = tool.execute(tool_call.function.arguments)
            print(f"Result: {result}")

Example

examples/openai_integration.py
View on GitHub →