Skip to content

Commit 8343053

Browse files
deepharnessHarness
authored andcommitted
feat: [SSCA-4065]: Minor refactor SCS/STO tools with improved output formatting (#78)
* Removed do not include section * Fixed minor comments * feat: [SSCA-4077]: Added ordering * minor updated * feat: [SSCA-4077]: Adding pagination * feat: add taskfile for codegen and refactor SCS/STO tools with improved output formatting
1 parent 340bbbf commit 8343053

File tree

4 files changed

+396
-273
lines changed

4 files changed

+396
-273
lines changed

pkg/appseccommons/utility.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import (
99
)
1010

1111
// NewToolResultTextWithPrompts creates a new CallToolResult with a text content and optional prompts
12-
func NewToolResultTextWithPrompts(eventType string, event string, prompts []string, module string, columns []string) *mcp.CallToolResult {
12+
func NewToolResultTextWithPrompts(eventType string, event string, prompts []string, module string, args ...any) *mcp.CallToolResult {
1313
// Create the base content with the text
1414
contents := []mcp.Content{
1515
mcp.TextContent{
1616
Type: "text",
17-
Text: builder.Reg.Build(eventType, []byte(event), module, columns),
17+
Text: builder.Reg.Build(eventType, []byte(event), module, args...),
1818
},
1919
}
2020

pkg/harness/tools/prompts.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,5 @@ func RegisterPrompts(mcpServer *server.MCPServer) {
2020
- If no dates are supplied, default startDate to 60 days ago and endDate to now.`).
2121
Build())
2222

23-
prompts.Append(
24-
p.NewPrompt().
25-
SetName("list_artifact_sources").
26-
SetDescription("Hints for formatting the list_artifact_sources results.").
27-
SetResultDescription("Markdown-table instructions").
28-
SetText(`When you call list_artifact_sources, always present the final answer as a markdown table with columns:
29-
30-
| Type | Sub-Type | Name | Source ID | Prod Deployments | Non-Prod Deployments | Count | STO Total |
31-
32-
Leave any unsupported field empty if it is missing.
33-
Also generate follow on prompts to get more details about the artifacts.`).
34-
Build())
35-
3623
p.AddPrompts(prompts, mcpServer)
3724
}

0 commit comments

Comments
 (0)