Skip to content
AgentsKit

@agentskit/tools — Interfaces

API interfaces for @agentskit/tools.

#Interface: DefineZodToolConfig<TSchema>

Defined in: zod.ts:21

#Type Parameters

#TSchema

TSchema extends ZodLike

#Properties

#category?

optional category?: string

Defined in: zod.ts:39


#description?

optional description?: string

Defined in: zod.ts:23


#dispose?

optional dispose?: () => MaybePromise<void>

Defined in: zod.ts:37

#Returns

MaybePromise<void>


#execute?

optional execute?: (args, context) => unknown

Defined in: zod.ts:32

#Parameters

args

InferZodOutput<TSchema>

context

ToolExecutionContext

#Returns

unknown


#init?

optional init?: () => MaybePromise<void>

Defined in: zod.ts:36

#Returns

MaybePromise<void>


#name

name: string

Defined in: zod.ts:22


#requiresConfirmation?

optional requiresConfirmation?: boolean

Defined in: zod.ts:31


#schema

schema: TSchema

Defined in: zod.ts:24


#tags?

optional tags?: string[]

Defined in: zod.ts:38


#toJsonSchema?

optional toJsonSchema?: (schema) => JSONSchema7

Defined in: zod.ts:30

Convert the Zod schema to JSON Schema. Users must supply this themselves (e.g. via zod-to-json-schema), keeping the zod dependency entirely optional.

#Parameters

schema

TSchema

#Returns

JSONSchema7


#Interface: EgressPolicy

Defined in: safe-fetch.ts:8

Default-deny egress policy (ADR-0010). All outbound HTTP from tools should pass through safeFetch / checkEgress so a model-supplied or redirected URL cannot reach internal infrastructure (SSRF).

#Properties

#allowedHosts?

optional allowedHosts?: string[]

Defined in: safe-fetch.ts:19

Literal hostname allowlist. If set, every request (and redirect hop) must match exactly — overrides allowPrivateHosts. Wildcards unsupported by design.


#allowPrivateHosts?

optional allowPrivateHosts?: boolean

Defined in: safe-fetch.ts:14

Allow requests to private / loopback / link-local addresses. Off by default so an agent can't reach AWS IMDS (169.254.169.254), the loopback interface, or RFC1918 services. Enable only for vetted internal targets.


#maxRedirects?

optional maxRedirects?: number

Defined in: safe-fetch.ts:21

Max redirects to follow; each hop is re-gated. Default 3.


#Interface: FetchUrlConfig

Defined in: fetch-url.ts:4

#Properties

#allowedHosts?

optional allowedHosts?: string[]

Defined in: fetch-url.ts:28

Hostname allowlist. If set, every request (and every redirect hop) must match a literal hostname in this list — overrides allowPrivateHosts. Wildcards are not supported by design.


#allowPrivateHosts?

optional allowPrivateHosts?: boolean

Defined in: fetch-url.ts:17

Allow requests to private/loopback/link-local addresses. Off by default so an agent can't reach AWS IMDS (169.254.169.254), the loopback interface, or internal RFC1918 services. Set true only when the tool runs against a vetted internal target.


#maxBytes?

optional maxBytes?: number

Defined in: fetch-url.ts:6

Maximum bytes to read from the response body. Default: 200 KB.


#maxRedirects?

optional maxRedirects?: number

Defined in: fetch-url.ts:22

Max redirects to follow. Each hop's resolved host is re-checked against allowPrivateHosts to block redirect-based SSRF. Default 3.


#timeoutMs?

optional timeoutMs?: number

Defined in: fetch-url.ts:8

Request timeout in ms. Default: 15000.


#userAgent?

optional userAgent?: string

Defined in: fetch-url.ts:10

Header value for User-Agent. Default: AgentsKit/1.0.


#Interface: FilesystemConfig

Defined in: filesystem.ts:5

#Properties

#basePath

basePath: string

Defined in: filesystem.ts:6


optional denySymlinks?: boolean

Defined in: filesystem.ts:13

When true, refuse to operate on symlinks at all (read, write, list). Default true — symlinks inside basePath can target outside the jail and would otherwise leak access. Set false only if you trust the contents of basePath.


#Interface: ShellConfig

Defined in: shell.ts:7

#Properties

#allowAny?

optional allowAny?: boolean

Defined in: shell.ts:22

Opt out of the allowlist requirement. When true, any executable is permitted — use only for trusted, sandbox-wrapped contexts. Off by default so a misconfigured agent cannot run arbitrary binaries.


#allowed?

optional allowed?: string[]

Defined in: shell.ts:16

Allowlist of permitted executables. Required by default — leave unset only when explicitly opting into the open mode via allowAny:true. Each entry is matched against the command's first token (the executable name).


#cwd?

optional cwd?: string

Defined in: shell.ts:26

Working directory passed to the child process.


#env?

optional env?: ProcessEnv

Defined in: shell.ts:32

Environment for the child. Defaults to an empty object so secrets in the parent process environment do not leak into the executed command unless explicitly forwarded.


#maxOutput?

optional maxOutput?: number

Defined in: shell.ts:24

Cap on combined stdout/stderr per invocation. Default 1 MB.


#timeout?

optional timeout?: number

Defined in: shell.ts:9

Per-command timeout in ms. Default 30s.


#Interface: SlackToolConfig

Defined in: slack.ts:5

#Properties

#fetch?

optional fetch?: {(input, init?): Promise<Response>; (input, init?): Promise<Response>; }

Defined in: slack.ts:8

Override fetch (mainly for tests). Defaults to the global fetch.

#Call Signature

(input, init?): Promise<Response>

MDN Reference

Parameters
input

URL | RequestInfo

init?

RequestInit

Returns

Promise<Response>

#Call Signature

(input, init?): Promise<Response>

MDN Reference

Parameters
input

string | URL | Request

init?

RequestInit

Returns

Promise<Response>


#signal?

optional signal?: AbortSignal

Defined in: slack.ts:10


#timeoutMs?

optional timeoutMs?: number

Defined in: slack.ts:9


#webhookUrl

webhookUrl: string

Defined in: slack.ts:6


#Interface: SqliteQueryConfig

Defined in: sqlite-query.ts:4

#Properties

#maxRows?

optional maxRows?: number

Defined in: sqlite-query.ts:9

Max rows returned. Defaults to 100.


#path

path: string

Defined in: sqlite-query.ts:5


#readOnly?

optional readOnly?: true

Defined in: sqlite-query.ts:7

Reserved for v2; only true is accepted today.


#Interface: WebSearchConfig

Defined in: web-search.ts:13

#Properties

#apiKey?

optional apiKey?: string

Defined in: web-search.ts:20


#maxResponseBytes?

optional maxResponseBytes?: number

Defined in: web-search.ts:25

Maximum provider response body size. Defaults to 2 MiB.


#maxResults?

optional maxResults?: number

Defined in: web-search.ts:21


#provider?

optional provider?: WebSearchProvider

Defined in: web-search.ts:19

Which backend to use. 'auto' (default) picks the best available: Serper if SERPER_API_KEY is set, Tavily if TAVILY_API_KEY is set, otherwise falls back to an unauthenticated DuckDuckGo HTML scrape.


optional search?: (query) => Promise<WebSearchResult[]>

Defined in: web-search.ts:29

Custom search function — overrides every other path.

#Parameters

query

string

#Returns

Promise<WebSearchResult[]>


#signal?

optional signal?: AbortSignal

Defined in: web-search.ts:27

Caller cancellation signal.


#timeoutMs?

optional timeoutMs?: number

Defined in: web-search.ts:23

Overall deadline for provider and custom-search work. Defaults to 15s.


#Interface: WebSearchResult

Defined in: web-search.ts:5

#Properties

#snippet

snippet: string

Defined in: web-search.ts:8


#title

title: string

Defined in: web-search.ts:6


#url

url: string

Defined in: web-search.ts:7

Explore nearby