Skip to main content
StackOne tools work with OpenAI’s function calling to build AI agents that access business data.
Supported languages: TypeScript and Python.
  • Convert tools to OpenAI function schemas automatically
  • Execute functions with built-in handling
  • Build conversational agents with tool execution
  • Multi-step workflows for complex tasks

Calling actions

1

Install

2

Fetch Tools

Two approaches to retrieving tools:
  1. Fetch Tools (with filtering) — fetch all tools upfront with optional filters applied.
  2. Search & Execute — hand the model just tool_search + tool_execute and let the agent discover what it needs at runtime.
See Tool Discovery for more details on which may be best in your scenario.
By default this fetches every tool enabled for the account. Narrow it by passing providers (specific connectors) or actions — exact names or glob patterns, following the provider_operation_entity tool naming (e.g. workday_*, or *_list_* for read-only tools).
3

Run the agent loop

Create the completion with the tools attached, then execute any tool calls the model makes:

Example

A full runnable example:
Actions that download a file (for example googledrive_unified_download_file, documents_download_file, or any *_unified_download_file) return raw bytes plus metadata, not parsed JSON. The SDK decides from the response Content-Type: JSON is parsed as usual, and anything else is treated as a file download.TypeScript — because execute() is typed to return a JSON object, use the exported isBinaryDownloadResult guard to narrow the result to the file shape.
The narrowed result describes the file:Pythoncall() and execute() both return the dict directly (it isn’t wrapped in a result object), so read its values with dict keys like result["content"].
The returned dict, from both call() and execute():
content is raw bytes and is not JSON-serializable. If you forward tool results to an LLM (or anything that re-serializes to JSON), handle or strip the content key. For example, base64-encode it on the LLM-facing path.

Troubleshooting

Execute a tool

Direct execution is useful for testing and debugging. In production, your agent framework handles tool calls automatically.

Next steps

Observability

Diagnose failing calls and monitor what your agent runs.

Tool Defense

Protect your agent from malicious content in tool results.