AgentKit actions are framework-agnostic. Define an action once, then export it as a tool for any of the five supported AI frameworks using a single adapter function.
You can also use the adapter functions directly with a custom tool manifest:
Low-level adapter usage
import { buildToolManifest } from '@goatnetwork/agentkit/providers';import { toOpenAITools } from '@goatnetwork/agentkit/adapters';// Build manifest from a list of actionsconst actions = provider.list();const manifest = buildToolManifest(actions);// Convert to any framework formatconst tools = toOpenAITools(manifest);
When you define a Zod schema on an action, AgentKit automatically converts it to JSON Schema for the tool manifest using zod-to-json-schema. This means your Zod validations (string patterns, min/max, enums) are faithfully represented in the tool definitions that LLMs see.
When your AI framework invokes a tool, route the call back through the ExecutionRuntime:
Tool call handler pattern
async function handleToolCall( toolName: string, toolInput: unknown, runtime: ExecutionRuntime, provider: ActionProvider, context: ActionContext,) { const action = provider.get(toolName); const result = await runtime.run(action, context, toolInput, { confirmed: true, // Or implement a confirmation flow }); if (!result.ok) { return { error: result.error, errorCode: result.errorCode }; } return result.output;}
The adapter functions only generate tool definitions (schemas). Actual action execution always goes through the ExecutionRuntime, which enforces policy, validation, retries, and all other runtime guarantees.