builtin-tool

Build and register agent-callable builtin tools with manifest JSON and runtime wiring.

1|Updated May 9, 2026
One-click install
npx skills add https://github.com/duwenji/generative-ai-oss-tutorials --skill builtin-tool-duwenji
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: builtin-tool
Source: https://github.com/duwenji/generative-ai-oss-tutorials/tree/main/sandbox/lobe-chat/.agents/skills/builtin-tool
Command: npx skills add https://github.com/duwenji/generative-ai-oss-tutorials --skill builtin-tool-duwenji

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a complete, structured blueprint for authoring a new builtin tool so the agent can discover, validate, execute, and render it correctly across all required runtime and UI surfaces.

Core Features & Use Cases

  • End-to-end tool authoring structure: Define the tool’s manifest and types, implement a pure ExecutionRuntime, wire an Executor for frontend dispatch, and register all surfaces in the central registries.
  • Correct multi-surface UI integration: Build and register the required Inspector and optional Render, Placeholder, Streaming, Intervention, and Portal components for a consistent chat experience.
  • Robust correctness and debugging checklist: Use stable identifiers (lobe-<domain>), consistent ApiName typing, proper result/state contracts, i18n keys, and registry wiring to prevent common failures like “tool not found” or missing UI surfaces.

Quick Start

Create a new package under packages/builtin-tool-<name>/ and implement the required manifest/types/system role plus an ExecutionRuntime, then wire Inspector/Executor and register the tool in the builtin tool registries.

Frequently Asked Questions about builtin-tool

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

FAQPage Schema
How do I build an agent-callable builtin tool that shows up correctly in the chat UI?

To build an agent-callable builtin tool, you define a manifest JSON schema for each ApiName, implement a pure ExecutionRuntime returning BuiltinServerRuntimeOutput, wire a BaseExecutor for dispatch, and register all Inspector and optional UI components in the central registries.

What is the best way to structure a new builtin tool package for agent runtime discovery?

The best way to structure a new builtin tool package is creating a package under builtin-tool-<name>/, defining the manifest and types, implementing the pure service-injected ExecutionRuntime, and wiring the BaseExecutor layer to preserve result-state on failure via a toResult funnel.

Do I need to implement all UI surfaces like Streaming and Portal when adding a new builtin tool?

You do not need all UI surfaces when adding a builtin tool; only the Inspector component is required, while Render, Placeholder, Streaming, Intervention, and Portal components are optional depending on the specific chat experience you want to render.

Why does my agent builtin tool fail with a tool not found error during execution?

A builtin tool not found error typically occurs when stable identifiers like lobe-<domain> are missing, ApiName typing is inconsistent, or the tool lacks proper registry and i18n wiring needed for the agent runtime to discover and validate the manifest.

How does the BaseExecutor wiring layer handle state preservation when a builtin tool execution fails?

The BaseExecutor wiring layer handles state preservation on failure by routing all execution paths through a toResult funnel, ensuring the pure ExecutionRuntime returns a BuiltinServerRuntimeOutput that maintains consistent result and state contracts even during errors.

Can I extend existing builtin tools with new methods without breaking the agent runtime?

You can extend existing builtin tools with new methods by adding the new ApiName to the manifest JSON schema, implementing the corresponding ExecutionRuntime logic, and updating the BaseExecutor and registry wiring to keep multi-surface UI integration consistent.