useAgentTools

Read registered tool metadata from the nearest AgentProvider. Returns an array of tool registrations with name and description.

import { useAgentTools } from "@allem-sdk/agents";

Returns

TypeDescription
AgentToolRegistration[]Array of registered tools with name and optional description

Usage

import { useAgentTools, useAllemAgent } from "@allem-sdk/agents";

function AgentUI() {
  const tools = useAgentTools();
  const { currentToolCalls } = useAllemAgent();

  return (
    <div>
      <h3>Available tools:</h3>
      <ul>
        {tools.map((t) => (
          <li key={t.name}>
            {t.name}
            {currentToolCalls.some((c) => c.toolName === t.name) && " (running)"}
          </li>
        ))}
      </ul>
    </div>
  );
}