Skip to main content

Basic usage

import { useTool } from '@trevi/sdk';

function RunTool() {
  const { call, loading, data, error } = useTool('tool_name');

  const handleRun = async () => {
    await call({});
  };

  return (
    <button onClick={handleRun} disabled={loading}>
      Run tool
    </button>
  );
}

Tips

Keep tool inputs small and focused. If a tool returns structured output, render it directly in your UI.