-
Notifications
You must be signed in to change notification settings - Fork 28
Description
Description
When calling a non-existent tool (e.g., mcp_context_info), instead of receiving a "tool not found" error, the system returns the synthetic context_info content (the prunable-tools list).
Steps to Reproduce
- Have DCP plugin installed and enabled
- Try to call any non-existent tool, e.g.,
mcp_context_info - Instead of an error, you receive the
<prunable-tools>list
Expected Behavior
Calling a non-existent tool should return an error like "tool not found" or similar.
Actual Behavior
The synthetic context_info tool output (containing the prunable-tools list) is returned, making it appear as if the tool "succeeded" but with unexpected content.
Root Cause
Found in lib/messages/utils.ts line 69:
// createSyntheticAssistantMessageWithToolPart function
return {
parts: [{
type: "tool",
callID: SYNTHETIC_CALL_ID,
tool: "context_info", // <-- This synthetic tool name
state: {
status: "completed",
output: content, // <-- prunable-tools list
title: "Context Info",
},
}],
}The DCP plugin creates synthetic tool results with tool: "context_info" to inject the prunable-tools list into the conversation. When a user tries to call a non-existent tool, this synthetic content gets returned instead of a proper error.
Suggested Fix
Option 1: Rename the synthetic tool to something clearly internal, like:
_dcp_internal_context_info__synthetic_context_infodcp:context_info
Option 2: Prefix with underscore to indicate internal use: _context_info
This would prevent confusion when users accidentally try to call non-existent tools.
Environment
- DCP version: latest (@tarquinen/opencode-dcp@latest)
- OpenCode version: 1.0.216+