Altar.LATER.Executor (Altar v0.1.2)

View Source

Stateless tool execution for the Local Agent & Tool Execution Runtime (LATER).

This module provides a pure, stateless API to execute a registered tool using a validated Altar.ADM.FunctionCall. It looks up the tool in the Altar.LATER.Registry, invokes the implementation with the provided args, and returns an Altar.ADM.ToolResult via the validating constructor.

Summary

Functions

Execute a tool call against the given registry.

Functions

execute_tool(registry, function_call)

Execute a tool call against the given registry.

The function is pure with respect to input arguments: it looks up the implementation function via the supplied registry pid/name and deterministically constructs a ToolResult based on the outcome of executing that function with function_call.args.

  • If the tool is found and executes without raising, returns {:ok, %ToolResult{is_error: false, content: result}}.
  • If the tool raises, returns {:ok, %ToolResult{is_error: true, content: %{error: ...}}}.
  • If the tool is not found, returns {:ok, %ToolResult{is_error: true, content: %{error: ...}}}.