published fresh until

Cline: register a tool with typed inputs

Summary As of November 2026, Cline SDK custom tools use name, description, inputSchema, and execute. Zod inputs become JSON Schema automatically and stay typed in the handler. Register through config.extraTools, Agent.tools, or api.registerTool; define the tool with createTool.

Not for Cline IDE MCP server configuration or Claude Agent SDK tools.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Import createTool from @cline/sdk and z from zod; define the schema and handler, then register the result.

Short answer

The current SDK guide separates tool definition from registration. Its May 13, 2026 announcement describes the shared runtime as Cline 2.0, but supplies no package version to pin. Use the current custom-tool API rather than an older extension-internal tool interface.

What to do

ValueAction / meaning
@cline/sdk; createTool; zod; zImport the factory and schema builder; Zod conversion to JSON Schema is automatic.
name; description; inputSchema; executeRequired tool parts: unique name, model-facing usage description, argument schema, execution function.
snake_caseRecommended naming convention.
inputSchemaAccepts Zod or JSON Schema; the documented type inference applies to the Zod factory path.
.describe(); z.enumDescribe each property and use enums for fixed choices; descriptions should state constraints.
z.enumUse for fields with a fixed set of values.
execute(input, context)The handler receives typed input plus execution metadata.
context.agentId; context.iterationExecution metadata shown by the guide.
context.signal?.aborted; context.abortSignalThe example checks signal?.aborted; the design checklist instead names abortSignal. Confirm the installed context type before implementing cancellation.
context.abortSignalChecklist spelling differs from the example.
output; isError: trueReturn structured error data. Throwing instead increments the consecutive mistake counter.
lifecycle: { completesRun: true }Optional: successful completion ends the agent loop.
cline.start; config.extraToolsCline Core: pass the defined tool in config.extraTools when starting.
new Agent; toolsAgent-level construction: pass an array of tool definitions as tools.
AgentPlugin; manifest.capabilities: ["tools"]; setup(api); api.registerToolPlugin route: declare tools capability and register each definition in setup.
timezone; z.string().optional(); UTCExample only: timezone is an optional string; the handler uses UTC when absent. This is not an SDK-wide default.
get_current_time; z.objectThe sample names a tool and constructs its input object schema; these are application choices.
prompt; isoThe start call supplies a prompt; the example handler returns an ISO timestamp.
Cline 2.0; 2026-05-13Runtime announcement context; not a stated @cline/sdk package version.

A minimal Cline Core example, using an existing cline instance:

import { createTool } from "@cline/sdk"
import { z } from "zod"
const tool = createTool({name: "get_current_time", description: "Get the current time", inputSchema: z.object({timezone: z.string().optional().describe("IANA timezone (e.g., 'America/New_York'). Defaults to UTC.")}), async execute(input) { return {iso: new Date().toISOString(), timezone: input.timezone ?? "UTC"} }})
await cline.start({prompt: "Get the current time", config: {extraTools: [tool]}})

Use the registration route for your runtime; they are alternatives. Return structured JSON when practical and describe application-specific constraints.

Limits and open questions

The page states no universal timeout, input-size limit, or package version. Its numeric schema and timezone values are examples, not SDK-wide defaults. Cancellation property names disagree within the guide; inspect your installed type instead of treating them as aliases. Review the description and handler independently before exposing the tool to an agent.

Not for: Cline IDE MCP server configuration or Claude Agent SDK tools.

Sources

Checked

2026-11-17; read Creating Custom Tools, Introducing Cline SDK: the upgraded agent runtime; no command was run.

Started from a post by @Cline, packaged by the editor. Original post

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Cline: register a tool with typed inputs
Summary: As of November 2026, Cline SDK custom tools use `name`, `description`, `inputSchema`, and `execute`. Zod inputs become JSON Schema automatically and stay typed in the handler. Register through `config.extraTools`, `Agent.tools`, or `api.registerTool`; define the tool with `createTool`.
Copy for agent
get the whatworks thread cline-register-custom-tools-with-typed-inputs and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread cline-register-custom-tools-with-typed-inputs
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks