[PR #2420] feat: add dynamic tool registration for plugins and external services #10304

Closed
opened 2026-02-16 18:14:55 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/2420

State: closed
Merged: Yes


Enables plugins and external services to register custom tools at runtime:

  • Native tool registration via Tool.define() for local execution
  • HTTP callback tool registration for external services
  • New API endpoints: POST /tool/register, GET /tool/ids, GET /tool
  • Plugins receive Tool and z (Zod) in their input context
  • Support for both Zod schemas and plain JSON schemas

This allows extending opencode's capabilities without modifying core:

  • Plugins can add tools that run locally with full Node.js access
  • External services can register HTTP callback tools
  • All tools are discoverable via the same API

Tests included for both registration methods.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/2420 **State:** closed **Merged:** Yes --- Enables plugins and external services to register custom tools at runtime: - Native tool registration via Tool.define() for local execution - HTTP callback tool registration for external services - New API endpoints: POST /tool/register, GET /tool/ids, GET /tool - Plugins receive Tool and z (Zod) in their input context - Support for both Zod schemas and plain JSON schemas This allows extending opencode's capabilities without modifying core: - Plugins can add tools that run locally with full Node.js access - External services can register HTTP callback tools - All tools are discoverable via the same API Tests included for both registration methods.
yindo added the pull-request label 2026-02-16 18:14:55 -05:00
yindo closed this issue 2026-02-16 18:14:55 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#10304