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

Let the LLM discover and execute tools on its own. Instead of loading all tools upfront, pass tool_search + tool_execute and the LLM finds what it needs:
from stackone_ai import StackOneToolSet

toolset = StackOneToolSet(
    search={"method": "semantic", "top_k": 3},
    execute={"account_ids": ["your-account-id"]},
)

# LLM receives only 2 tools - it searches and executes autonomously
openai_tools = toolset.openai(mode="search_and_execute")

response = client.chat.completions.create(
    model="gpt-5.4",
    messages=messages,
    tools=openai_tools,
    tool_choice="auto",
)

# Execute tool calls
for tool_call in response.choices[0].message.tool_calls:
    result = toolset.execute(tool_call.function.name, tool_call.function.arguments)
See Tool Search for the full agent loop example.

Next Steps