🔄 Big News! bazed.ai is now sagentic.ai. Same vision, new name!

Skip to content

@sagentic-ai/sagentic-af / isTool

isTool() ​

ts
isTool<A, R>(
   name,
   description,
   args,
   returns): (constructor, _context) => void

Decorator for agent classes that can be used as tools.

Type parameters ​

• A

• R

Parameters ​

• name: string

Name of the tool

• description: string

• args: ZodType<A, ZodTypeDef, A>

Zod schema for parameters of the tool

• returns: ZodType<R, ZodTypeDef, R>

Zod schema for return value of the tool

Returns ​

Function

Parameters ​

• constructor: Constructor<Agent>

• _context: any

Returns ​

void

Source ​

src/tool.ts:154