Skip to content

Commit b313db5

Browse files
committed
feat(mcp): 优化list_cases工具功能描述
1 parent b4bd5e9 commit b313db5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

mod/mcp/mcp.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ func (s *MCPServer) getTools() []Tool {
329329
},
330330
{
331331
Name: "list_cases",
332-
Description: "List all running cases in the current project",
332+
Description: "List all cases (scenes) in the current project with their status (created, running, stopped, etc.)",
333333
InputSchema: ToolSchema{
334334
Type: "object",
335335
Properties: map[string]Property{},
@@ -1060,8 +1060,14 @@ func (s *MCPServer) toolListCases() (ToolResult, error) {
10601060
if len(cases) == 0 {
10611061
output += "No cases found.\n"
10621062
} else {
1063+
stateCounts := make(map[string]int)
10631064
for _, c := range cases {
10641065
output += fmt.Sprintf("- ID: %s, Name: %s, Status: %s, Type: %s\n", c.GetId(), c.Name, c.State, c.Type)
1066+
stateCounts[c.State]++
1067+
}
1068+
output += fmt.Sprintf("\nSummary: %d total cases\n", len(cases))
1069+
for state, count := range stateCounts {
1070+
output += fmt.Sprintf("- %s: %d\n", state, count)
10651071
}
10661072
}
10671073

0 commit comments

Comments
 (0)