ServerTool
Defined in: packages/engine/src/lib/agent-session/server-tool.ts:56
A tool the model can call, executed inside the Engine process.
The agent loop is experimental in 0.3 and may change in any minor release.
Type Parameters
Section titled “Type Parameters”Input
Output
Section titled “Output”Output
Properties
Section titled “Properties”approval
Section titled “approval”
readonlyapproval:"never"
Defined in: packages/engine/src/lib/agent-session/server-tool.ts:70
Defaults to never when declared through serverTool.
description
Section titled “description”
readonlydescription:string
Defined in: packages/engine/src/lib/agent-session/server-tool.ts:60
Description shown to the model.
readonlyinput:ZodType<Input>
Defined in: packages/engine/src/lib/agent-session/server-tool.ts:62
Schema the model’s arguments are validated against. Must be pure and deterministic because it may be evaluated more than once per call.
readonlylocus:"server"
Defined in: packages/engine/src/lib/agent-session/server-tool.ts:66
Always server.
readonlyname:string
Defined in: packages/engine/src/lib/agent-session/server-tool.ts:58
Name the model calls the tool by. Must match ^[A-Za-z0-9_-]{1,64}$.
output
Section titled “output”
readonlyoutput:ZodType<Output>
Defined in: packages/engine/src/lib/agent-session/server-tool.ts:64
Schema the tool’s result is validated against. Must be pure and deterministic because it may be evaluated more than once per call.
sideEffect
Section titled “sideEffect”
readonlysideEffect:"idempotent"|"read_only"|"non_idempotent"
Defined in: packages/engine/src/lib/agent-session/server-tool.ts:68
Defaults to non_idempotent when declared through serverTool.
Methods
Section titled “Methods”execute()
Section titled “execute()”execute(
input,ctx):Promise<Output>
Defined in: packages/engine/src/lib/agent-session/server-tool.ts:72
Runs the tool. Mutating tools must check ctx.signal before any side effect.
Parameters
Section titled “Parameters”Input
Returns
Section titled “Returns”Promise<Output>
summarize()
Section titled “summarize()”summarize(
output):string
Defined in: packages/engine/src/lib/agent-session/server-tool.ts:74
Pure, synchronous, user-safe one-line description of a result.
Parameters
Section titled “Parameters”output
Section titled “output”Output
Returns
Section titled “Returns”string