Header menu logo Nao

Tool Type

A tool that an agent can invoke to perform actions or retrieve information. Supports optional capabilities: content-type declaration, verify, and revert.

Record fields

Record Field Description

Description

Full Usage: Description

Field type: string

Human-readable description shown to the LLM so it knows when to use the tool

Field type: string

Execute

Full Usage: Execute

Field type: ToolContext -> string -> Task<string>

Execute the tool with its context (for dynamic permission requests) and a string input, returning the result.

Field type: ToolContext -> string -> Task<string>

Name

Full Usage: Name

Field type: string

Unique name used by the agent to reference this tool

Field type: string

OutputContentType

Full Usage: OutputContentType

Field type: ContentMeta

Declared content type of the tool's output (framework carries, does not interpret)

Field type: ContentMeta

Permissions

Full Usage: Permissions

Field type: ResourceAccess list

Static resource permissions this tool declares it needs. The runtime requests these through the context before each execution; a denied one short-circuits the call.

Field type: ResourceAccess list

Provenance

Full Usage: Provenance

Field type: ToolProvenance option

Where this tool came from (used by the feedback/adjust system to target patches).

Field type: ToolProvenance option

Revert

Full Usage: Revert

Field type: (RevertContext -> Task<Result<unit, string>>) option

Revert/undo changes the tool has made to external resources.

Field type: (RevertContext -> Task<Result<unit, string>>) option

Schema

Full Usage: Schema

Field type: ToolParameter list

Schema describing the named parameters this tool accepts in its JSON input object. Empty means the tool takes no parameters (or a single free-form string input).

Field type: ToolParameter list

Verify

Full Usage: Verify

Field type: (string -> string -> Task<Result<unit, string>>) option

Verify the output is correct given the input. Returns Ok or Error with reason.

Field type: (string -> string -> Task<Result<unit, string>>) option

Version

Full Usage: Version

Field type: string option

Optional version identifier (e.g. "1.0"). None = unversioned; matches any requested version.

Field type: string option

Instance members

Instance member Description

this.CanRevert

Full Usage: this.CanRevert

Returns: bool

Whether this tool declares revert capability

Returns: bool

this.CanVerify

Full Usage: this.CanVerify

Returns: bool

Whether this tool declares verify capability

Returns: bool

this.InvokeAsync

Full Usage: this.InvokeAsync

Parameters:
Returns: Task<string>

Run the tool: request each declared static permission through the context first, then execute. A denied declared permission short-circuits with a refusal message instead of running the tool.

ctx : ToolContext
input : string
Returns: Task<string>

Static members

Static member Description

Tool.Create(name, description, permissions, execute)

Full Usage: Tool.Create(name, description, permissions, execute)

Parameters:
Returns: Tool

Create a tool that receives its execution context (to request permission dynamically) and declares the static permissions it needs (auto-requested before each run).

name : string
description : string
permissions : ResourceAccess list
execute : ToolContext -> string -> Task<string>
Returns: Tool

Tool.Create(name, description, execute)

Full Usage: Tool.Create(name, description, execute)

Parameters:
    name : string
    description : string
    execute : string -> Task<string>

Returns: Tool

Create a simple tool with just name, description, and execute (text/plain, no revert). The execute function ignores the context; use the 4-argument overload for tools that request permission dynamically or declare static permissions.

name : string
description : string
execute : string -> Task<string>
Returns: Tool

Type something to start searching.