Documentation Index
Fetch the complete documentation index at: https://docs.cline.bot/llms.txt
Use this file to discover all available pages before exploring further.
import { createTool } from "@cline/sdk"
Creates a typed tool. Also re-exported from @cline/agents and @cline/core.
const tool = createTool({
name: "get_current_time",
description: "Return the current time as ISO string.",
inputSchema: { type: "object", properties: {} },
execute: async (_input, context) => {
return { now: new Date().toISOString() }
},
})
inputSchema can be either JSON Schema or a Zod schema.
interface AgentTool<TInput = unknown, TOutput = unknown> {
name: string
description: string
inputSchema: Record<string, unknown>
execute: (input: TInput, context: AgentToolContext, onChange?: (update: unknown) => void) => Promise<TOutput>
timeoutMs?: number
retryable?: boolean
maxRetries?: number
}
Defaults from createTool:
| Field | Default |
|---|
timeoutMs | 30000 |
retryable | true |
maxRetries | 3 |
AgentToolContext
interface AgentToolContext {
agentId: string
conversationId: string
iteration: number
abortSignal?: AbortSignal
metadata?: Record<string, unknown>
}
interface ToolPolicy {
enabled?: boolean
autoApprove?: boolean
}
Tool names not listed in a policy map default to enabled and auto-approved.
interface ToolCallRecord {
id: string
name: string
input: unknown
output: unknown
error?: string
durationMs: number
startedAt: Date
endedAt: Date
}