add-custom-tool

Implement Kotlin ToolHandler classes with canHandle, score, and suspend handle for KAgentic.

1|Updated Jul 28, 2025
One-click install
npx skills add https://github.com/anoopg87/KAgentic --skill add-custom-tool
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-custom-tool
Source: https://github.com/anoopg87/KAgentic/tree/main/.claude/skills/add-custom-tool
Command: npx skills add https://github.com/anoopg87/KAgentic --skill add-custom-tool

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Provide a clear, production-ready pattern for adding new tool capabilities to KAgentic agents so developers can extend agent functionality reliably and consistently without breaking tool selection or execution flow.

Core Features & Use Cases

  • Implement ToolHandler: Guidance for implementing canHandle, score, and suspend handle methods with recommended patterns (keyword, regex, combined matching).
  • Selection & Scoring: Deterministic scoring strategies and fast pattern matching to ensure correct tool arbitration among multiple candidates.
  • Integration & Testing: Instructions for writing unit tests (runBlocking), safe async handling, error reporting, and registering the tool with AgentFramework for real-world use (DateTime, Weather, API calls, file readers, calculators).

Quick Start

Implement a Kotlin ToolHandler named DateTimeTool that implements canHandle, score, and suspend handle, add unit tests using runBlocking, and register the tool with AgentFramework.

Frequently Asked Questions about add-custom-tool

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

FAQPage Schema
How do I add custom tools to Kotlin agents?

To add custom tools to Kotlin agents, you implement a ToolHandler with canHandle, score, and suspend handle methods, then register the tool with the AgentFramework to extend agent capabilities.

What is the best way to implement tool selection scoring in KAgentic?

Implement deterministic scoring strategies and fast pattern matching using keyword, regex, or combined matching within the score method to ensure correct tool arbitration among multiple candidates.

How do I test custom ToolHandler implementations in Kotlin?

Write unit tests for your ToolHandler using runBlocking to validate safe async handling, deterministic scoring, and safe error reporting when integrating custom tools with the AgentFramework.

Does KAgentic support adding external API calls to agent workflows?

Yes, you can extend KAgentic agents by creating custom tool implementations for external API calls, DateTime lookups, weather queries, file reading, and computation within AgentFramework-driven workflows.

Why does my custom agent tool fail during selection arbitration?

Tool selection failures often occur when scoring strategies are non-deterministic or pattern matching is too slow; ensuring deterministic scoring and fast pattern matching in canHandle and score resolves this.