Tool Calling Playground

Test AI tool execution with built-in tools. See inputs, outputs, and execution time.

Middleware

Active middleware is applied to each tool call.

Execute a tool to see results

Code Example

import { createTool, createToolkit } from 'agent-tools-kit/tools'
import { z } from 'zod'

const calculatorTool = createTool({
  name: 'calculator',
  description: 'Perform mathematical calculations',
  schema: z.object({ expression: z.string() }),
  execute: async ({ expression }) => {
    const result = eval(expression)
    return { expression, result, success: true }
  },
})

const toolkit = createToolkit({
  tools: [calculatorTool],
  middleware: [loggingMiddleware],
})

// Execute tool
const result = await toolkit.execute({
  id: 'call-1',
  name: 'calculator',
  arguments: { expression: '2 + 2 * 10' },
})