fix(agentic): add missing plan MCP aliases

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Virgil 2026-04-02 07:27:48 +00:00
parent ceaa1601de
commit 7389b2f801
2 changed files with 58 additions and 0 deletions

View file

@ -240,6 +240,10 @@ func (s *PrepSubsystem) registerPlanTools(server *mcp.Server) {
Name: "agentic_plan_read",
Description: "Read an implementation plan by ID. Returns the full plan with all phases, criteria, and status.",
}, s.planRead)
mcp.AddTool(server, &mcp.Tool{
Name: "agentic_plan_get",
Description: "Read an implementation plan by slug with progress details and full phases.",
}, s.planGetCompat)
mcp.AddTool(server, &mcp.Tool{
Name: "agentic_plan_update",
@ -280,6 +284,10 @@ func (s *PrepSubsystem) registerPlanTools(server *mcp.Server) {
Name: "plan_check",
Description: "Check whether a plan or phase is complete using the compatibility surface.",
}, s.planCheck)
mcp.AddTool(server, &mcp.Tool{
Name: "agentic_plan_check",
Description: "Check whether a plan or phase is complete using the compatibility surface.",
}, s.planCheck)
mcp.AddTool(server, &mcp.Tool{
Name: "plan_update",
@ -290,6 +298,10 @@ func (s *PrepSubsystem) registerPlanTools(server *mcp.Server) {
Name: "plan_update_status",
Description: "Update a plan lifecycle status by slug.",
}, s.planUpdateStatusCompat)
mcp.AddTool(server, &mcp.Tool{
Name: "agentic_plan_update_status",
Description: "Update a plan lifecycle status by slug.",
}, s.planUpdateStatusCompat)
mcp.AddTool(server, &mcp.Tool{
Name: "plan_delete",
@ -300,11 +312,19 @@ func (s *PrepSubsystem) registerPlanTools(server *mcp.Server) {
Name: "plan_archive",
Description: "Archive a plan by slug without deleting the local record.",
}, s.planArchiveCompat)
mcp.AddTool(server, &mcp.Tool{
Name: "agentic_plan_archive",
Description: "Archive a plan by slug without deleting the local record.",
}, s.planArchiveCompat)
mcp.AddTool(server, &mcp.Tool{
Name: "plan_from_issue",
Description: "Create an implementation plan from a tracked issue slug or ID.",
}, s.planFromIssue)
mcp.AddTool(server, &mcp.Tool{
Name: "agentic_plan_from_issue",
Description: "Create an implementation plan from a tracked issue slug or ID.",
}, s.planFromIssue)
}
func (s *PrepSubsystem) planCreate(_ context.Context, _ *mcp.CallToolRequest, input PlanCreateInput) (*mcp.CallToolResult, PlanCreateOutput, error) {

View file

@ -3,10 +3,12 @@
package agentic
import (
"context"
"strings"
"testing"
core "dappco.re/go/core"
mcpsdk "github.com/modelcontextprotocol/go-sdk/mcp"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
@ -197,3 +199,39 @@ func TestPlan_ReadPlan_Ugly_EmptyFile(t *testing.T) {
_, err := readPlan(dir, "empty")
assert.Error(t, err)
}
func TestPlan_RegisterPlanTools_Good_RegistersAgenticCompatibilityAliases(t *testing.T) {
server := mcpsdk.NewServer(&mcpsdk.Implementation{Name: "test", Version: "0.1.0"}, &mcpsdk.ServerOptions{
Capabilities: &mcpsdk.ServerCapabilities{
Tools: &mcpsdk.ToolCapabilities{ListChanged: true},
},
})
subsystem := &PrepSubsystem{}
subsystem.RegisterTools(server)
client := mcpsdk.NewClient(&mcpsdk.Implementation{Name: "test", Version: "0.1.0"}, nil)
clientTransport, serverTransport := mcpsdk.NewInMemoryTransports()
serverSession, err := server.Connect(context.Background(), serverTransport, nil)
require.NoError(t, err)
t.Cleanup(func() { _ = serverSession.Close() })
clientSession, err := client.Connect(context.Background(), clientTransport, nil)
require.NoError(t, err)
t.Cleanup(func() { _ = clientSession.Close() })
result, err := clientSession.ListTools(context.Background(), nil)
require.NoError(t, err)
var toolNames []string
for _, tool := range result.Tools {
toolNames = append(toolNames, tool.Name)
}
assert.Contains(t, toolNames, "agentic_plan_get")
assert.Contains(t, toolNames, "agentic_plan_check")
assert.Contains(t, toolNames, "agentic_plan_update_status")
assert.Contains(t, toolNames, "agentic_plan_archive")
assert.Contains(t, toolNames, "agentic_plan_from_issue")
}