Skip to main content
All signatures on this page are verified against the current @exulu/backend source. For constructor options, see Configuration.

Constructor

See Configuration for the full options object.

Instance method: execute()

Runs the tool directly from your own code, outside of a chat session. Useful for testing, background jobs, or triggering tool logic programmatically.
agent
string
required
Agent ID on whose behalf the tool runs. IMP resolves the agent record, its configured model, and the API key needed for any provider calls that the tool’s execution chain makes.
config
ExuluConfig
required
The app’s ExuluConfig — needed to resolve tools and provider keys at runtime.
user
User
Calling user. Used for access control (for example, OAuth token lookup keyed on userId) and for logging.
inputs
any
Input values passed to execute. Must conform to the tool’s inputSchema.
project
string
Project ID, forwarded to tool-conversion utilities that scope agentic context searches to a project.
items
string[]
Session item IDs, forwarded to tool-conversion utilities for session-scoped tools.
result
string
The result string from the tool’s last yielded or returned value.
job
string
Job ID if the tool enqueued background work.
items
Item[]
Items for context-retrieval tools.
execute() resolves the agent by ID from the app singleton, then converts the tool via the same pipeline the framework uses during a live chat. It logs verbosely to the console — this method is intended for internal and testing use, not as the primary invocation path in production workflows.

Static factory: ExuluTool.internal()

Creates a tool whose type is one of the framework-managed values ("agent" or "context"). Not part of the public API — package consumers should use new ExuluTool(...), which only accepts a PublicToolType.
Internally this constructs the tool as type: "function", then mutates instance.type to the requested managed type — bypassing the constructor guard without weakening it for consumers.
ExuluTool.internal() is for IMP framework internals. Using it to construct "agent" tools manually produces tools whose IDs IMP expects to be real agent UUIDs — passing anything else causes a UUID lookup crash at runtime. Do not call it in application code.

Properties

All constructor options are exposed as public properties after construction: