lloyal-agents API Reference
    Preparing search index...

    Class WebResearchTool

    Spawn parallel web-research sub-agents for a set of questions.

    Similar to ResearchTool but designed for web-source pipelines. Each question gets its own agent in a shared-root pool with access to web_search, fetch_page, and report tools. Hard-cut agents that exhaust their turns without reporting get a grammar-constrained scratchpad extraction via generate to recover partial findings.

    Must call setToolkit before the tool is executed.

    Hierarchy

    • Tool<{ questions: string[] }>
      • WebResearchTool
    Index

    Constructors

    Properties

    description: string

    Human-readable description shown to the model

    name: string

    Tool name — used as the function identifier in tool calls

    parameters: JsonSchema = ...

    JSON Schema describing the tool's expected arguments

    Methods

    • Execute the tool with parsed arguments

      Called by the agent pool when the model emits a tool call matching this tool's name. The return value is JSON-serialized and prefilled back into the agent's context as a tool result.

      Returns an Effection Operation — implement as a generator method. The operation runs inside the agent pool's scope, so it has access to Ctx, Store, and Events contexts for nested agent spawning.

      Parameters

      • args: { questions: string[] }

        Parsed arguments from the model's tool call

      Returns Operation<unknown>

      Tool result (will be JSON-serialized)

    • Inject the toolkit that sub-agents will use. Must be called before execute.

      Parameters

      • toolkit: Toolkit

      Returns void