Briyah SDK - v2.0.6
    Preparing search index...

    Interface NativeToolDefinition

    A tool implemented as a real function by the host process (an SDK consumer or the operator), as opposed to a user-authored ToolDefinition whose code is a stored string. Native tools are trusted, are never persisted, and are registered globally via Briyah.registerTool.

    interface NativeToolDefinition {
        description: string;
        group?: string;
        handler: (
            args: Record<string, any>,
            helpers: ToolHelpers,
            context: unknown,
        ) => Promise<any>;
        maxResultChars?: number;
        name: string;
        parameters: ToolParameter[];
        timeoutMs?: number;
    }
    Index
    description: string

    Human/LLM-facing description rendered into the agent's prompt.

    group?: string

    The name of the tool pack this tool belongs to. Set by registerToolPacks rather than by the pack's own definitions, and used only to group the tool in the UI — resolution and execution ignore it.

    handler: (
        args: Record<string, any>,
        helpers: ToolHelpers,
        context: unknown,
    ) => Promise<any>

    The tool implementation. Receives the LLM-supplied args, Briyah's helpers, and the host's opaque context. Returns a JSON-serializable value.

    maxResultChars?: number

    Per-call result budget in characters of serialized JSON (default 16_384).

    Raise it for a tool whose whole job is to hand the agent a document — a reference lookup that comes back in six numbered parts is worse than one that comes back whole. Leave it alone for tools that return rows or records: every result is appended verbatim to the calling agent's history, so a generous budget on a chatty tool is what pushes an agent into compaction. Whatever the budget, an oversized result is clipped structurally rather than truncated into unparseable JSON — see ToolExecutionService.truncateResult.

    name: string

    Unique tool name (letters, numbers, hyphens, underscores). Referenced by agent.toolNames.

    parameters: ToolParameter[]

    Declared parameters the LLM may supply. Do NOT declare tenant-scoping here — use context.

    timeoutMs?: number

    Per-call timeout in ms (default 30_000, capped at 120_000).