You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: [ML-1425]: Added a create_follow_up_prompt tool to generate prompt events based on the action_data (#217)
* 1a33cd chore: [ML-1425]: Added readme
* d77cf7 chore: [ML-1397]: updated prompt
* bd7e7b chore: [ML-1425]: Added a create_follow_up_prompt tool to generate prompt events based on the action_data
* f2ce07 chore: [ML-1425]: Added a create_follow_up_prompt tool to generate prompt events based on the action_data
Copy file name to clipboardExpand all lines: README.md
+46Lines changed: 46 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -648,6 +648,52 @@ Environment variables are prefixed with `HARNESS_`:
648
648
649
649
The server uses a Harness API key for authentication. This can be set via the `HARNESS_API_KEY` environment variable.
650
650
651
+
### Using the create_follow_up_prompt Tool to generate actionable prompt events
652
+
653
+
The `create_follow_up_prompt` tool allows you to generate actionable prompt events that appear as buttons in the UI. These buttons can navigate users to specific pages within the Harness platform.
654
+
655
+
Here's how to use it:
656
+
657
+
```json
658
+
{
659
+
"actions": [
660
+
{
661
+
"text": "Button Text",
662
+
"action": "OPEN_ENTITY_NEW_TAB",
663
+
"data": {
664
+
"pageName": "PAGE_NAME",
665
+
"metadata": {
666
+
"<KEY>": "<VALUE>"
667
+
}
668
+
}
669
+
}
670
+
]
671
+
}
672
+
```
673
+
674
+
#### Parameters:
675
+
676
+
-`text`: The text to display on the button
677
+
-`action`: The action to perform (currently supports `OPEN_ENTITY_NEW_TAB`)
678
+
-`data`: Contains navigation information
679
+
-`pageName`: The page to navigate to (e.g., `ExecutionPipelineView`, `PipelineStudio`, etc.)
680
+
-`metadata`: Key-value pairs needed for the target page (e.g., `{"executionId": "abc123", "pipelineId": "xyz789"}`)
If you provide an array of strings instead of the actions object, these strings will be added to the message box as quick prompts that users can click on:
691
+
692
+
```go
693
+
// Add quick prompts to the message box
694
+
quickPrompts:=`["Show me pipeline details", "List recent executions", "Analyze performance"]`
695
+
```
696
+
651
697
## Notes for Local Testing
652
698
653
699
There might be certain tools that are not added in external mode or vice-versa, for local testing, following changes in `pkg/harness/tools.go` need to be done in mcp-server code to enable that certain tool in both internal and external modes.
SetDescription("Summarize a Harness pipeline's structure, purpose, and behavior.").
31
31
SetResultDescription("Comprehensive pipeline summary with key details.").
32
-
SetText(`{"standard": "I need you to summarise the pipeline with the input pipeline identifier.\n\n1. **What to do?**\n - Fetch any required metadata or definitions for the pipeline.\n - Analyze its configuration and structure.\n - Make the necessary tool calls to get the pipeline related details.\n - Produce a concise, accurate summary of the pipeline's design and behavior.\n\n2. **Tools to call to get a complete overview of pipeline**\n - get_pipeline\n - get_pipeline_summary\n - list_pipelines\n - get_environment\n - get_service\n - list_settings (with category as NOTIFICATIONS)\n - get_secret\n - list_triggers\n\n3. **Must-have details in the output** (acceptance criteria):\n - **Purpose and Objective**: What this pipeline is designed to accomplish (e.g. \"Builds and deploys a Node.js microservice to staging and production.\")\n - **High-Level Architecture**: Major components and phases (build, test, security scanning, deployment).\n - **Environment Flow**: How the execution moves through environments.\n - **Key Technologies**: Languages, frameworks, deployment targets, and tools used.\n - **Trigger Conditions**: What events start the pipeline (Git commits, manual triggers, schedules).\n - **Approval Gates**: Any manual approvals required, and who must sign off.\n - **Dependencies**: External dependencies such as environments, infrastructures, connectors, services, other pipelines this one relies on, etc with their ids if available.\n - **Success Criteria**: What defines a successful run.\n\n4. **Output format**\n Return the following data ONLY in a markdown format, DO NOT use JSON literals:\n {\n \"purpose\": string,\n \"architecture\": string,\n \"environment\": string,\n \"technologies\": string[],\n \"triggers\": string[],\n \"approvals\": string[],\n \"dependencies\": string[],\n \"success_criteria\": string,\n \"past_execution_details\": string[]\n }"}`).
32
+
SetText(`{
33
+
"standard": "I need you to summarise the pipeline with the input pipeline identifier.\n 1. What to do?\n - Fetch any required metadata or definitions for the pipeline.\n - Analyze its configuration and structure.\n - Make the necessary tool calls to get the pipeline related details.\n - Before making any tool call, for all other tool calls you MUST send a message on what tool you are going to call and why.\n - Produce a concise, accurate summary of the pipeline's design and behavior.\n 2. Tools to call to get a complete overview of pipeline:\n - get_pipeline\n - get_pipeline_summary\n - list_pipelines\n - get_environment\n - get_service\n - list_settings (with category as NOTIFICATIONS)\n - get_secret\n - list_triggers\n - list_executions\n - create_follow_up_prompt\n 3. Must-have details in the summary (acceptance criteria):\n - Purpose and Objective: What this pipeline is designed to accomplish (e.g. 'Builds and deploys a Node.js microservice to staging and production.')\n - High-Level Architecture: Major components and phases (build, test, security scanning, deployment).\n - Environment Flow: How the execution moves through environments.\n - Key Technologies: Languages, frameworks, deployment targets, and tools used.\n - Trigger Conditions: What events start the pipeline (Git commits, manual triggers, schedules).\n - Approval Gates: Any manual approvals required, and who must sign off.\n - Dependencies: External dependencies such as environments, infrastructures, connectors, services, other pipelines this one relies on, etc with their ids if available.\n - Success Criteria: What defines a successful run.\n 4. Instructions for calling create_follow_up_prompt tool:\n Follow these steps in order:\n a. Make a tool call to list_executions to fetch the execution ID of the latest execution of the given pipeline\n b. Make a tool call to create_follow_up_prompt with these parameters:\n - action_data: The following JSON data stringified:\n {\"actions\": [\n {\n \"text\": \"View Latest Execution\",\n \"action\": \"OPEN_ENTITY_NEW_TAB\",\n \"data\": {\n \"pageName\": \"ExecutionPipelineView\",\n \"metadata\": {\n \"executionId\": \"executionId-value\",\n \"pipelineId\": \"pipeline-id\"\n }\n }\n },\n {\n \"text\": \"View Pipeline\",\n \"action\": \"OPEN_ENTITY_NEW_TAB\",\n \"data\": {\n \"pageName\": \"PipelineStudio\",\n \"metadata\": {\n \"id\": \"pipeline-id\"\n }\n }\n }\n ]}\n - Replace \"executionId-value\" with the actual execution ID from the list_executions response\n - Replace \"pipeline-id\" with the pipeline identifier\n - If there are no executions available, MUST use this JSON data instead(with only option view pipeline):\n {\"actions\": [\n {\n \"text\": \"View Pipeline\",\n \"action\": \"OPEN_ENTITY_NEW_TAB\",\n \"data\": {\n \"pageName\": \"PIPELINE_STUDIO\",\n \"metadata\": {\n \"id\": \"pipeline-id\"\n }\n }\n }\n ]}\n\n 5. Output format:\n Return the following summary data ONLY in a markdown format, DO NOT use JSON literals:\n {\n \"### Purpose\": string,\n \"### Architecture\": string,\n \"### Environment\": string,\n \"### Technologies\": string[],\n \"### Triggers\": string[],\n \"### Approvals\": string[],\n \"### Dependencies\": string[],\n \"### Success Criteria\": string,\n \"### Past Execution Details\": string[]\n } \n Return the tool response exactly as received, in markdown format. DO NOT use JSON literals. The pipeline summary should the final response."
mcp.WithDescription("Creates a follow up prompt event with the specified data."),
409
+
mcp.WithString("action_data",
410
+
mcp.Required(),
411
+
mcp.Description("A JSON string in one of these formats: 1) An array of action objects: {\"actions\": [{\"text\": \"Button Text\", \"action\": \"OPEN_ENTITY_NEW_TAB\", \"data\": {\"pageName\": \"PAGE_NAME\", \"metadata\": {\"<KEY>\": \"<VALUE>\"}}}]} OR 2) just a single string action without any array: \"Action1\""),
0 commit comments