BeamAgent.Tools.Registry (beam_agent v0.1.0)

Copy Markdown View Source

Dispatches a tool call to the module registered for it.

The registry itself holds no tools — callers pass a tools map (%{atom() => module}, each module implementing BeamAgent.Tools.Behaviour) through BeamAgent.API.run/2's :tools option, and it flows down to every call here. This keeps the harness domain-agnostic: it ships no built-in tools of its own, only the dispatch mechanism.

Summary

Functions

Looks up tool_name in tools and executes it with args.

Types

tools()

@type tools() :: %{optional(atom()) => module()}

Functions

call(tools, tool_name, args)

@spec call(tools(), atom(), map()) :: {:ok, term()} | {:error, term()}

Looks up tool_name in tools and executes it with args.

Returns {:error, :unknown_tool} if tool_name isn't a key in tools.