diff options
Diffstat (limited to 'internal/executor/agentmcp.go')
| -rw-r--r-- | internal/executor/agentmcp.go | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/internal/executor/agentmcp.go b/internal/executor/agentmcp.go index 2177fbd..c0088c5 100644 --- a/internal/executor/agentmcp.go +++ b/internal/executor/agentmcp.go @@ -73,11 +73,17 @@ type recordProgressInput struct { Message string `json:"message" jsonschema:"a short progress note describing what you are doing"` } +type proposeEpicInput struct { + Name string `json:"name" jsonschema:"short descriptive name for the epic; matched by exact name to reuse an existing epic instead of creating a duplicate"` + Description string `json:"description,omitempty" jsonschema:"optional longer description of the initiative"` + StoryIDs []string `json:"story_ids" jsonschema:"the story IDs to group under this epic"` +} + func textResult(text string) *mcp.CallToolResult { return &mcp.CallToolResult{Content: []mcp.Content{&mcp.TextContent{Text: text}}} } -// newAgentServer builds an MCP server exposing the four agent tools bound to ch. +// newAgentServer builds an MCP server exposing the five agent tools bound to ch. func newAgentServer(ch AgentChannel) *mcp.Server { s := mcp.NewServer(&mcp.Implementation{Name: "claudomator", Version: "1"}, nil) @@ -137,6 +143,21 @@ func newAgentServer(ch AgentChannel) *mcp.Server { return textResult("Noted."), nil, nil }) + mcp.AddTool(s, &mcp.Tool{ + Name: "propose_epic", + Description: "Group one or more stories under a new or existing epic (matched by exact name) when they form a cohesive initiative. Only call this when you've been given several story IDs and independently judge that they belong together.", + }, func(ctx context.Context, _ *mcp.CallToolRequest, in proposeEpicInput) (*mcp.CallToolResult, any, error) { + id, err := ch.ProposeEpic(ctx, EpicProposal{ + Name: in.Name, + Description: in.Description, + StoryIDs: in.StoryIDs, + }) + if err != nil { + return nil, nil, err + } + return textResult("Proposed epic " + id), nil, nil + }) + return s } |
