Skip to content

[FEATURE]: /tool, /status, /exec server endpoints #21771

@micuintus

Description

@micuintus
  • I've checked that this feature hasn't been suggested before.

TL;DR

Add three new server API endpoints: /tool (inject external tool results), /status (report status/progress), and /exec (execute tools by name). These enable plugins to interact with sessions programmatically.

More detail

  • POST /session/:id/tool — Injects an external tool call + result into a session. Uses the external flag on ToolPart to mark results as externally produced. Depends on the external flag PR.
  • POST /session/:id/status — Appends a status/progress message to a session. Useful for plugins to report progress of long-running operations.
  • POST /session/:id/exec — Executes a registered tool by name with given arguments, returning the result. Enables plugins to invoke opencode's built-in tools programmatically.

Part of the plugin primitives work tracked in #20018 (split from #21687).

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions