effect-ai-tool

Define type-safe AI tools and toolkits using Effect AI Tool and Toolkit APIs.

1|Updated Aug 24, 2026
One-click install
npx skills add https://github.com/lambdasolver2/opencode-effect-harness --skill effect-ai-tool-lambdasolver2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-ai-tool
Source: https://github.com/lambdasolver2/opencode-effect-harness/tree/main/packages/module-typescript/assets/skills/effect-ai-tool
Command: npx skills add https://github.com/lambdasolver2/opencode-effect-harness --skill effect-ai-tool-lambdasolver2

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires effect, @effect/ai-openai.

What problem does it solve? Building LLM integrations with tool calling requires type-safe tool definitions, validated parameters, structured failure handling, and composable toolkits, which is error-prone when done ad hoc with raw JSON schemas. ## Core Features & Use Cases - User-Defined Tools: Create tools with Tool.make using Schema.Struct parameters, success/failure schemas, failureMode strategies, and service dependencies. - Toolkit Composition: Combine tools with Toolkit.make, implement handlers via toLayer or toHandlers, and execute them through toolkit.handle streams with preliminary progress results. - Provider-Defined & Dynamic Tools: Integrate provider-native capabilities like OpenAI WebSearch and FileSearch via Tool.providerDefined and OpenAiTool, plus runtime-discovered tools via Tool.dynamic. - Use Case: Build a coding agent that exposes read-file and query-database tools to an LLM, with tagged-error failures, approval flows for destructive operations, and dependency-injected handlers. ## Quick Start Ask the AI to define an Effect AI tool with Tool.make that has typed parameters, a success schema, and a handler implemented through Toolkit.toLayer.

Frequently Asked Questions about effect-ai-tool

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I define a tool with Effect AI Tool.make?

Call Tool.make with a name string and a config object containing description, parameters as Schema.Struct, success and failure schemas, and optional failureMode. Extract types with Tool.Parameters, Tool.Success, and Tool.Failure.

How do I implement tool handlers in Effect AI?

Use Toolkit.make to compose tools, then call toLayer with an object mapping tool names to handler functions returning Effects. Alternatively use toHandlers to get a Context instead of a Layer for direct provision.

What is the difference between Tool.make, Tool.dynamic, and Tool.providerDefined?

Tool.make defines user tools with typed Effect schemas. Tool.dynamic handles runtime-discovered tools where raw JSON Schema params are typed as unknown. Tool.providerDefined models provider-native capabilities like OpenAI WebSearch.

Does Effect AI support tool approval flows?

Yes, Tool.make and Tool.dynamic accept needsApproval. When set, automatic resolution emits a tool-approval-request instead of executing, and the caller responds with Prompt.toolApprovalResponsePart to approve or deny.

How do tool failures work with failureMode in Effect AI?

The failureMode option controls failure strategy: 'error' sends failures to the Effect error channel, while 'return' captures failures as tool results. Declare all tagged errors in the failure schema for type safety.