Skip to content

Commit 332ef6f

Browse files
Saranya-jenaHarness
authored andcommitted
chore: [ML-1318]: Added custom prompt of pipeline summariser (#128)
* chore: [ML-1318]: Added custom prompt of pipeline summariser Signed-off-by: Saranya-jena <[email protected]>
1 parent 029d04d commit 332ef6f

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed

cmd/harness-mcp-server/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"github.com/harness/harness-mcp/cmd/harness-mcp-server/config"
1515
"github.com/harness/harness-mcp/pkg/harness"
1616
"github.com/harness/harness-mcp/pkg/harness/auth"
17+
"github.com/harness/harness-mcp/pkg/harness/prompts"
1718
"github.com/harness/harness-mcp/pkg/modules"
1819
"github.com/mark3labs/mcp-go/mcp"
1920
"github.com/mark3labs/mcp-go/server"
@@ -379,6 +380,9 @@ func runStdioServer(ctx context.Context, config config.Config) error {
379380
// Create module registry
380381
moduleRegistry := modules.NewModuleRegistry(&config, toolsets)
381382

383+
// Register prompts generic
384+
prompts.RegisterPrompts(harnessServer)
385+
382386
// Register prompts from all enabled modules
383387
err = moduleRegistry.RegisterPrompts(harnessServer)
384388
if err != nil {

pkg/harness/prompts/prompts.go

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ 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(
23+
prompts.Append(
2424
p.NewPrompt().SetName("ask_confirmation_for_update_and_delete_operations").
2525
SetDescription("Ensure that Update or Delete operations are executed ONLY after user confirmation.").
2626
SetResultDescription("Execute operation if user input 'yes', cancel otherwise.").
@@ -36,6 +36,48 @@ func RegisterPrompts(mcpServer *server.MCPServer) {
3636
`).
3737
Build())
3838

39+
// Pipeline summarization prompt
40+
prompts.Append(
41+
p.NewPrompt().SetName("pipeline_summarizer").
42+
SetDescription("Summarize a Harness pipeline's structure, purpose, and behavior.").
43+
SetResultDescription("Comprehensive pipeline summary with key details.").
44+
SetText(`I need you to summarise the pipeline with the input pipeline identifier.
45+
46+
1. **What to do?**
47+
- Fetch any required metadata or definitions for the pipeline.
48+
- Analyze its configuration and structure.
49+
- Make the necessary tool calls to get the pipeline related details.
50+
- Produce a concise, accurate summary of the pipeline's design and behavior.
51+
52+
2. **What tools to call?**
53+
- get_pipeline
54+
- list_pipelines
55+
- get_environment
56+
- get_service
57+
58+
3. **Must-have details in the output** (acceptance criteria):
59+
- **Purpose and Objective**: What this pipeline is designed to accomplish (e.g. "Builds and deploys a Node.js microservice to staging and production.")
60+
- **High-Level Architecture**: Major components and phases (build, test, security scanning, deployment).
61+
- **Environment Flow**: How the execution moves through environments.
62+
- **Key Technologies**: Languages, frameworks, deployment targets, and tools used.
63+
- **Trigger Conditions**: What events start the pipeline (Git commits, manual triggers, schedules).
64+
- **Approval Gates**: Any manual approvals required, and who must sign off.
65+
- **Dependencies**: External dependencies such as environments, infrastructures, connectors, services, other pipelines this one relies on, etc with their ids if available.
66+
- **Success Criteria**: What defines a successful run.
67+
68+
4. **Output format**
69+
Return the following data ONLY in a markdown format, DO NOT use JSON literals:
70+
{
71+
"purpose": string,
72+
"architecture": string,
73+
"environment": string,
74+
"technologies": string[],
75+
"triggers": string[],
76+
"approvals": string[],
77+
"dependencies": string[],
78+
"success_criteria": string
79+
}`).
80+
Build())
3981

4082
p.AddPrompts(prompts, mcpServer)
4183
}

0 commit comments

Comments
 (0)