Skip to content
cccskills
FreePublished on GitHub

tool

Guide for creating tools using CallableTool2 and Params pattern, plus YAML agent registration

The English summary is being prepared. Showing the original description.

See how to install

Files included (2)

  • SKILL.md2.7 KB
  • references/guide.md10.9 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Tool Development Guide

Create custom tools with the CallableTool2 + Params pattern, then register them in a YAML agent file.

Quick Template

"""Brief description of what this tool does."""
from kimi_agent_sdk import CallableTool2, ToolError, ToolOk, ToolReturnValue

class Params(BaseModel):
    """Define tool parameters here."""
    required_param: str = Field(
        description="Description of this parameter for the LLM."
    )
    optional_param: str | None = Field(
        default=None,
        description="Optional parameter with default value."
    )

class MyTool(CallableTool2):
    name: str = "MyTool" # Tool identifier
    description: str = "What this tool does."  # For LLM to understand usage
    params: type[Params] = Params # Link to Params class

    async def __call__(self, params: Params) -> ToolReturnValue:
        """Execute the tool logic."""
        try:
            # Your tool logic here
            result = f"Processed: {params.required_param}"
            return ToolOk(output=result)
        except Exception as e:
            return ToolError(
                message=str(e),
                output="Partial output if available",
                brief="Short error summary"
            )

Key Patterns

  • Return values: ToolOk(output=...) on success; ToolError(message=..., output=..., brief=...) on failure.
  • Validators: ge/le/gt/lt (numeric), min_length/max_length/pattern (strings/collections), default_factory for mutable defaults.
  • Best practices: type hints everywhere; clear Field(description=...); always async __call__; handle exceptions → ToolError; one tool = one job.

Registration

Every new tool must be registered in a YAML agent file as "module.path:ClassName" under tools:. KimiToolset.load_tools() splits on the last :, imports the module, gets the class, instantiates, and adds it. Agent files: agent_worker.json (default), agent_boss.json, agent_subagent.json; base agents in kimi-cli/src/kimi_cli/agents/default/ (agent.yaml, coder.yaml, explore.yaml, plan.yaml). Child YAML tools: replaces the parent's list; use allowed_tools:/exclude_tools: to restrict. Use kimi_cli.tools.* prefix for new tools under kimi-cli/src/kimi_cli/tools/; the relocated shell / process / background-job infra (bash, pwsh, Run, FindStr, job_output, common, security, prompt_common) lives under kimi-cli/src/kimi_cli/tools/ and must be imported as kimi_cli.tools.*.

Full complete example, Params reference, background-task tools, interactive-session reuse, and YAML details: read references/guide.md.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

app

Free

Guide for the Kimix web frontend (src/app/) — vanilla TypeScript + Vite, SSE-based chat UI mirroring sse_cli.py. Use when modifying the frontend, adding new UI features, changing the API client, or understanding the message rendering pipeline.

The English summary is being prepared. Showing the original description.

Sikao-Engine/KimiX114Updated Oct 20, 2026

doc

Free

Guide for navigating and maintaining Kimix project documentation. Use when: (1) user asks about the docs structure, (2) user wants to add, update, or append content to project documents.

The English summary is being prepared. Showing the original description.

Sikao-Engine/KimiX114Updated Oct 20, 2026

Guide for using KimiX API utilities covering kimix, kimix.utils, kimix.base, kimix.dag, kimix.network, kimix.server, kimix.parser, kimix.cot, kimix.retrieval, kimix.summarize, and kimi_agent_sdk.

The English summary is being prepared. Showing the original description.

Sikao-Engine/KimiX114Updated Oct 20, 2026

Guide for Kimix opencode-style HTTP server (FastAPI + SSE), including route definitions, builtin endpoints, and app.post usage.

The English summary is being prepared. Showing the original description.

Sikao-Engine/KimiX114Updated Oct 20, 2026

serve

Free

Guide for the Kimix HTTP serve system — FastAPI backend + TypeScript/Vite frontend. Use when adding new backend endpoints, modifying the session manager, changing the frontend API client, or understanding how data flows from backend to UI. Covers dummy_app.py, dummy_session_manager.py, sse_cli.py, and src/app/.

The English summary is being prepared. Showing the original description.

Sikao-Engine/KimiX114Updated Oct 20, 2026

Guide for creating effective skills. Use when users want to create or update a skill that extends agent's capabilities.

The English summary is being prepared. Showing the original description.

Sikao-Engine/KimiX114Updated Oct 20, 2026

See all skills by Sikao-Engine

Report a problem with this skill