harness-mcp-v2 3.1.4 → 3.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -7
- package/build/prompts/create-agent.d.ts.map +1 -1
- package/build/prompts/create-agent.js +149 -121
- package/build/prompts/create-agent.js.map +1 -1
- package/build/registry/index.d.ts.map +1 -1
- package/build/registry/index.js +4 -0
- package/build/registry/index.js.map +1 -1
- package/build/registry/toolsets/knowledge-graph.d.ts +3 -0
- package/build/registry/toolsets/knowledge-graph.d.ts.map +1 -0
- package/build/registry/toolsets/knowledge-graph.js +283 -0
- package/build/registry/toolsets/knowledge-graph.js.map +1 -0
- package/build/registry/toolsets/semantic-layer.d.ts +3 -0
- package/build/registry/toolsets/semantic-layer.d.ts.map +1 -0
- package/build/registry/toolsets/semantic-layer.js +253 -0
- package/build/registry/toolsets/semantic-layer.js.map +1 -0
- package/build/tools/harness-execute.d.ts.map +1 -1
- package/build/tools/harness-execute.js +36 -2
- package/build/tools/harness-execute.js.map +1 -1
- package/build/utils/strip-meta.d.ts +15 -0
- package/build/utils/strip-meta.d.ts.map +1 -0
- package/build/utils/strip-meta.js +44 -0
- package/build/utils/strip-meta.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
## Harness MCP Server 2.0
|
|
2
2
|
|
|
3
|
-
An MCP (Model Context Protocol) server that gives AI agents full access to the Harness.io platform through 11 consolidated tools and
|
|
3
|
+
An MCP (Model Context Protocol) server that gives AI agents full access to the Harness.io platform through 11 consolidated tools and 213 resource types.
|
|
4
4
|
|
|
5
5
|
## Why Use This MCP Server
|
|
6
6
|
|
|
@@ -8,8 +8,8 @@ Most MCP servers map one tool per API endpoint. For a platform as broad as Harne
|
|
|
8
8
|
|
|
9
9
|
This server is built differently:
|
|
10
10
|
|
|
11
|
-
- **11 tools,
|
|
12
|
-
- **Full platform coverage.**
|
|
11
|
+
- **11 tools, 213 resource types.** A registry-based dispatch system routes `harness_list`, `harness_get`, `harness_create`, etc. to any Harness resource — pipelines, services, environments, orgs, projects, feature flags, cost data, and more. The LLM picks from 11 tools instead of hundreds.
|
|
12
|
+
- **Full platform coverage.** 36 default toolsets spanning CI/CD, GitOps, Feature Flags, Cloud Cost Management, Security Testing, Chaos Engineering, Database DevOps, Internal Developer Portal, Software Supply Chain, Infrastructure as Code Management, Governance, Service Overrides, Knowledge Graph, Visualizations, and more. Opt-in Ansible coverage is available when you need inventory and playbook data.
|
|
13
13
|
- **Multi-project workflows out of the box.** Agents discover organizations and projects dynamically — no hardcoded env vars needed. Ask "show failed executions across all projects" and the agent can navigate the full account hierarchy.
|
|
14
14
|
- **32 prompt templates.** Pre-built prompts for common workflows: build & deploy apps end-to-end, debug failed pipelines, review DORA metrics, triage vulnerabilities, optimize cloud costs, audit access control, plan feature flag rollouts, review pull requests, approve pending pipelines, and more.
|
|
15
15
|
- **Works everywhere.** Stdio transport for local clients (Claude Desktop, Cursor, Windsurf), HTTP transport for remote/shared deployments, Docker and Kubernetes ready.
|
|
@@ -1082,7 +1082,7 @@ Harness pipelines can be stored in three ways:
|
|
|
1082
1082
|
|
|
1083
1083
|
## Resource Types
|
|
1084
1084
|
|
|
1085
|
-
|
|
1085
|
+
213 resource types organized across 36 toolsets. Each resource type supports a subset of CRUD operations and optional execute actions.
|
|
1086
1086
|
|
|
1087
1087
|
### Platform
|
|
1088
1088
|
|
|
@@ -1638,7 +1638,7 @@ Inline PNG chart visualizations rendered from Harness data. These are metadata-o
|
|
|
1638
1638
|
|
|
1639
1639
|
## Toolset Filtering
|
|
1640
1640
|
|
|
1641
|
-
By default,
|
|
1641
|
+
By default, 36 of 37 toolsets are enabled. One toolset is opt-in and excluded from the defaults:
|
|
1642
1642
|
|
|
1643
1643
|
- **`ansible`** — Harness Ansible (inventories, playbooks, hosts, activity). Opt-in because it is project-scoped and adds concepts many users do not need.
|
|
1644
1644
|
|
|
@@ -1713,6 +1713,8 @@ Available toolset names:
|
|
|
1713
1713
|
| `overrides` | service_override |
|
|
1714
1714
|
| `settings` | setting |
|
|
1715
1715
|
| `visualizations` | visual_timeline, visual_stage_flow, visual_health_dashboard, visual_pie_chart, visual_bar_chart, visual_timeseries, visual_architecture |
|
|
1716
|
+
| `knowledge-graph` | kg_queryable_type_summary, kg_grammar, hql_query |
|
|
1717
|
+
| `semantic-layer` | kg_type, kg_related_type |
|
|
1716
1718
|
| `ai-evals` | eval_dataset, eval_dataset_item, evaluation, eval_run, eval_run_item, eval_run_by_eval, eval_metric, eval_metric_set, eval_metric_set_entry, eval_suite, eval_suite_evaluation, eval_suite_run, eval_target, eval_model, eval_annotation, eval_analytics, eval_git_settings, eval_registry_item |
|
|
1717
1719
|
| `iacm` | iacm_workspace, iacm_resource, iacm_module, iacm_workspace_costs, iacm_activity_resource_change |
|
|
1718
1720
|
| `ansible` *(opt-in)* | ansible_inventory, ansible_playbook, ansible_host, ansible_host_activity, ansible_activity |
|
|
@@ -1733,8 +1735,8 @@ Available toolset names:
|
|
|
1733
1735
|
|
|
|
1734
1736
|
+--------v---------+
|
|
1735
1737
|
| Registry | <-- Declarative resource definitions
|
|
1736
|
-
|
|
|
1737
|
-
|
|
|
1738
|
+
| 36 Toolsets | (data files, not code)
|
|
1739
|
+
| 213 Resource Types|
|
|
1738
1740
|
+--------+---------+
|
|
1739
1741
|
|
|
|
1740
1742
|
+--------v---------+
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-agent.d.ts","sourceRoot":"","sources":["../../src/prompts/create-agent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"create-agent.d.ts","sourceRoot":"","sources":["../../src/prompts/create-agent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAiYjE"}
|
|
@@ -45,100 +45,96 @@ If creating a new agent or updating an existing one, collect the following befor
|
|
|
45
45
|
### 1. Agent Metadata
|
|
46
46
|
- **Name**: Display name for the agent (e.g. "Code Coverage Agent", "PR Reviewer")
|
|
47
47
|
- **Description**: Brief description of the agent's purpose (optional)
|
|
48
|
-
- **UID**:
|
|
48
|
+
- **UID/UUID**: Always generate this from the name and pass it explicitly to create/update APIs. Do not rely on the create API fallback.
|
|
49
|
+
- Generation rule: prefix with \`ca_\`, then lowercase the name, convert spaces and hyphens (\`-\`) to \`_\`, replace any remaining non-alphanumeric runs with \`_\`, collapse duplicate \`_\`, and trim leading/trailing \`_\` from the slug portion (e.g. "Code Coverage Agent" → \`ca_code_coverage_agent\`, "PR Reviewer" → \`ca_pr_reviewer\`)
|
|
50
|
+
- If the generated UID conflicts with an existing agent, ask the user whether to reuse/update that agent or append a short suffix
|
|
49
51
|
|
|
50
52
|
### 2. Task Details
|
|
51
53
|
|
|
52
54
|
**This is an INTERACTIVE requirements gathering process. Ask clarifying questions and verify understanding with the user before proceeding.**
|
|
53
55
|
|
|
54
|
-
#### Step 1: Understand the Agent's Purpose
|
|
55
|
-
|
|
56
56
|
Ask and clarify the following with the user:
|
|
57
57
|
|
|
58
|
-
1. **Agent's exact goal**: What specific outcome should the agent achieve?
|
|
59
|
-
- Examples: "Increase code coverage to 80%", "Review PRs for security vulnerabilities", "Generate unit tests for uncovered functions"
|
|
60
|
-
- Be specific — avoid vague goals like "improve code quality"
|
|
58
|
+
1. **Agent's exact goal**: What specific outcome should the agent achieve? Be specific — avoid vague goals.
|
|
61
59
|
|
|
62
|
-
2. **Inputs the agent needs**:
|
|
63
|
-
- Repository information? (repo name, branch, PR number)
|
|
64
|
-
- Execution context? (pipeline execution ID, previous step outputs)
|
|
65
|
-
- Configuration? (coverage threshold, target files, exclusion patterns)
|
|
66
|
-
- Secrets? (API keys, tokens for external services)
|
|
60
|
+
2. **Inputs the agent needs**: Repository info? Execution context? Configuration? Secrets?
|
|
67
61
|
|
|
68
|
-
3. **Outputs the agent produces**:
|
|
69
|
-
- Files? (COVERAGE.md, test files, reports)
|
|
70
|
-
- External actions? (create PR, post comments, send notifications)
|
|
71
|
-
- Data? (metrics, logs, analysis results)
|
|
62
|
+
3. **Outputs the agent produces**: Files? External actions? Data/metrics?
|
|
72
63
|
|
|
73
|
-
4. **What the agent works on**:
|
|
74
|
-
- Specific file paths or patterns? (e.g., \`pkg/**/*.go\`, \`src/services/\`)
|
|
75
|
-
- External services? (GitHub API, Slack, monitoring systems)
|
|
76
|
-
- Databases or APIs? (read-only access, write operations)
|
|
64
|
+
4. **What the agent works on**: Specific file paths? External services? Databases/APIs?
|
|
77
65
|
|
|
78
|
-
5. **Task workflow**:
|
|
66
|
+
5. **Task workflow**: Step-by-step workflow (do 1, then 2, then 3, etc.)
|
|
79
67
|
|
|
80
|
-
6. **Constraints and preferences**:
|
|
81
|
-
- Examples: "Use idiomatic Go code", "Do not modify existing tests", "Keep reports under 10000 characters"
|
|
68
|
+
6. **Constraints and preferences**: Limitations, rules, or coding standards (e.g., "Use idiomatic Go code", "Do not modify existing tests")
|
|
82
69
|
|
|
83
|
-
7. **Definition of done**: How do you know the agent succeeded?
|
|
84
|
-
- Specific criteria? ("Coverage increased by X%", "All files have tests")
|
|
85
|
-
- Artifacts created? ("PR created with tests", "COVERAGE.md updated")
|
|
86
|
-
- Exit conditions? ("No security vulnerabilities found", "All checks passed")
|
|
70
|
+
7. **Definition of done**: How do you know the agent succeeded? Specific criteria, artifacts, or exit conditions.
|
|
87
71
|
|
|
88
|
-
|
|
72
|
+
### 3. Recommend Configuration
|
|
89
73
|
|
|
90
|
-
Based on
|
|
74
|
+
Based on requirements, recommend and verify with the user:
|
|
91
75
|
|
|
92
|
-
1. **Task instructions** (\`
|
|
76
|
+
1. **Task instructions** (\`PLUGIN_TASK\` env var):
|
|
93
77
|
- Break down the goal into detailed step-by-step instructions
|
|
94
78
|
- Include specific commands, file paths, and expected outcomes
|
|
95
|
-
- Reference inputs using
|
|
96
|
-
-
|
|
79
|
+
- Reference inputs using \`\${{inputs.fieldName}}\` syntax inside \`PLUGIN_TASK\` and other env vars
|
|
80
|
+
- Add \`## RULES\` section at the end with constraints formatted as markdown bullet points
|
|
97
81
|
|
|
98
82
|
2. **Runtime inputs** (\`inputs\` section in spec):
|
|
99
83
|
- Only add if user confirms runtime parameters are needed
|
|
100
84
|
- Map each input to what the agent needs (repo, branch, executionId, thresholds, etc.)
|
|
101
|
-
-
|
|
102
|
-
|
|
103
|
-
3. **User preferences** (RULES section in \`task\` field):
|
|
104
|
-
- Convert constraints and coding standards into a dedicated RULES section at the end of the task
|
|
105
|
-
- Format as a markdown section with bullet points
|
|
106
|
-
- Be specific and actionable
|
|
107
|
-
- Example: Add \`## RULES\\n- Use idiomatic Go code\\n- Do not modify existing tests\\n- Keep COVERAGE.md under 10000 characters\` at the end of the task
|
|
85
|
+
- **Always set a \`default\` value for every non-required input** — if \`\${{inputs.fieldName}}\` is referenced in \`PLUGIN_TASK\` or any env var and no value is supplied at runtime nor a default exists, the agent will error at execution time
|
|
108
86
|
|
|
109
|
-
|
|
87
|
+
3. **Connectors**:
|
|
110
88
|
- LLM connector for model access (required for all agents) - User must create via Harness UI or MCP
|
|
111
89
|
- MCP connectors for external services (GitHub, Slack, Harness platform, etc.) - only if needed
|
|
112
90
|
- All authentication and secrets are managed within the connectors
|
|
113
91
|
|
|
114
92
|
**Present this recommended configuration to the user and iterate until confirmed.**
|
|
115
93
|
|
|
116
|
-
###
|
|
94
|
+
### 4. Default Configuration & Inputs
|
|
117
95
|
|
|
118
|
-
**Agent Structure:** Agents use \`agent.step.
|
|
96
|
+
**Agent Structure:** Agents use \`agent.step.group.steps\` format — the run step is nested inside a named step group.
|
|
119
97
|
|
|
120
|
-
**Default
|
|
98
|
+
**Default structure:**
|
|
121
99
|
\`\`\`yaml
|
|
122
|
-
|
|
123
|
-
|
|
100
|
+
version: 1
|
|
101
|
+
agent:
|
|
102
|
+
step:
|
|
103
|
+
group:
|
|
104
|
+
steps:
|
|
105
|
+
- name: Agent
|
|
106
|
+
if: <+Always>
|
|
107
|
+
id: agent
|
|
108
|
+
run:
|
|
109
|
+
container:
|
|
110
|
+
image: pkg.harness.io/vrvdt5ius7uwygso8s0bia/harness-agents/harness-ai-agent:latest
|
|
111
|
+
env:
|
|
112
|
+
PLUGIN_TASK: |
|
|
113
|
+
<step-by-step task instructions>
|
|
114
|
+
PLUGIN_MAX_TURNS: 150
|
|
115
|
+
PLUGIN_HARNESS_CONNECTOR: \${{inputs.llmConnector.id}}
|
|
124
116
|
\`\`\`
|
|
125
117
|
|
|
126
118
|
**Required environment variables:**
|
|
127
119
|
\`\`\`yaml
|
|
128
120
|
env:
|
|
129
|
-
|
|
130
|
-
|
|
121
|
+
PLUGIN_TASK: | # Task instructions go here as a multiline string
|
|
122
|
+
<step-by-step instructions>
|
|
123
|
+
PLUGIN_MAX_TURNS: 150 # Adjust 100-200 based on task complexity
|
|
124
|
+
PLUGIN_HARNESS_CONNECTOR: \${{inputs.llmConnector.id}} # References llmConnector input's id property
|
|
131
125
|
\`\`\`
|
|
132
126
|
|
|
133
|
-
**
|
|
127
|
+
**MCP configuration (only if external services needed):**
|
|
134
128
|
\`\`\`yaml
|
|
135
|
-
|
|
129
|
+
env:
|
|
130
|
+
PLUGIN_MCP_FORMAT: harness
|
|
131
|
+
PLUGIN_MCP_SERVERS: <+connectorInputs.resolveList(<+inputs.mcpConnectors>)> # References mcpConnectors input
|
|
136
132
|
\`\`\`
|
|
137
133
|
|
|
138
|
-
**
|
|
134
|
+
**Optional model override (only if user explicitly requests it):**
|
|
139
135
|
\`\`\`yaml
|
|
140
|
-
|
|
141
|
-
|
|
136
|
+
env:
|
|
137
|
+
ANTHROPIC_MODEL: \${{inputs.modelName}} # Only add when user insists on a modelName input
|
|
142
138
|
\`\`\`
|
|
143
139
|
|
|
144
140
|
**Required inputs (always include):**
|
|
@@ -149,11 +145,9 @@ agent:
|
|
|
149
145
|
type: connector
|
|
150
146
|
required: true
|
|
151
147
|
default: your_llm_connector_id # User must replace with actual connector ID
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
required: true
|
|
156
|
-
default: arn:aws:bedrock:us-east-1:587817102444:application-inference-profile/7p8sn93lhspw # User may replace with their preferred model
|
|
148
|
+
ui:
|
|
149
|
+
connectorCategories:
|
|
150
|
+
- AI
|
|
157
151
|
\`\`\`
|
|
158
152
|
|
|
159
153
|
**Optional inputs (add as needed):**
|
|
@@ -164,6 +158,18 @@ agent:
|
|
|
164
158
|
default:
|
|
165
159
|
- your_github_mcp_connector # User must replace
|
|
166
160
|
- your_slack_mcp_connector # User must replace
|
|
161
|
+
ui:
|
|
162
|
+
component: array
|
|
163
|
+
input:
|
|
164
|
+
inputType: connector
|
|
165
|
+
inputConfig:
|
|
166
|
+
connectorTypes:
|
|
167
|
+
- Mcp
|
|
168
|
+
|
|
169
|
+
# Model name override - ONLY add if user explicitly requests it
|
|
170
|
+
modelName:
|
|
171
|
+
type: string
|
|
172
|
+
default: your_model_arn_or_id # User must replace with their model ARN or ID
|
|
167
173
|
|
|
168
174
|
# Custom parameters
|
|
169
175
|
repo_name:
|
|
@@ -171,6 +177,20 @@ agent:
|
|
|
171
177
|
default: my-org/my-repo
|
|
172
178
|
\`\`\`
|
|
173
179
|
|
|
180
|
+
**\`layout\` block (always include, only list fields that are present as inputs):**
|
|
181
|
+
|
|
182
|
+
The \`layout\` block controls what appears in the agent configuration UI. It contains **at most three items** — \`llmConnector\`, \`modelName\`, and \`mcpConnectors\` — and only those that exist as first-class input fields in the \`inputs\` section. Never include any other fields (e.g. custom inputs like \`repo_name\`) in the layout block:
|
|
183
|
+
|
|
184
|
+
\`\`\`yaml
|
|
185
|
+
agent:
|
|
186
|
+
layout:
|
|
187
|
+
- title: Agent Configuration
|
|
188
|
+
items:
|
|
189
|
+
- llmConnector # always present
|
|
190
|
+
- modelName # only if modelName input exists
|
|
191
|
+
- mcpConnectors # only if mcpConnectors input exists
|
|
192
|
+
\`\`\`
|
|
193
|
+
|
|
174
194
|
**Supported input types:** \`string\`, \`secret\`, \`boolean\`, \`connector\`, \`array\`
|
|
175
195
|
|
|
176
196
|
**IMPORTANT:** Users must create connectors via Harness UI or \`harness_create\` with \`resource_type="connector"\` before running the agent.
|
|
@@ -182,21 +202,25 @@ agent:
|
|
|
182
202
|
Assemble the complete agent YAML specification (\`spec\` field):
|
|
183
203
|
|
|
184
204
|
1. Start with \`version: 1\` and \`agent:\` structure
|
|
185
|
-
2. Create \`agent.step.
|
|
186
|
-
- \`
|
|
187
|
-
- \`
|
|
188
|
-
|
|
189
|
-
- \`
|
|
190
|
-
- \`
|
|
191
|
-
- \`
|
|
192
|
-
|
|
193
|
-
- \`
|
|
194
|
-
- \`
|
|
205
|
+
2. Create \`agent.step.group.steps\` block with a single step entry:
|
|
206
|
+
- \`name: Agent\`, \`if: <+Always>\`, \`id: agent\`
|
|
207
|
+
- \`run.container.image: pkg.harness.io/vrvdt5ius7uwygso8s0bia/harness-agents/harness-ai-agent:latest\`
|
|
208
|
+
- \`run.env\` section (all task config lives here as env vars):
|
|
209
|
+
- \`PLUGIN_TASK:\` — multiline string with step-by-step instructions and \`## RULES\` section
|
|
210
|
+
- \`PLUGIN_MAX_TURNS: 150\` (adjust 100-200 based on complexity)
|
|
211
|
+
- \`PLUGIN_HARNESS_CONNECTOR: \${{inputs.llmConnector.id}}\`
|
|
212
|
+
- \`PLUGIN_MCP_FORMAT: harness\` (only if MCPs needed)
|
|
213
|
+
- \`PLUGIN_MCP_SERVERS: <+connectorInputs.resolveList(<+inputs.mcpConnectors>)>\` (only if MCPs needed)
|
|
214
|
+
- \`ANTHROPIC_MODEL: \${{inputs.modelName}}\` (**only** if user explicitly requests a \`modelName\` input)
|
|
195
215
|
3. Add \`agent.inputs\` section with:
|
|
196
|
-
- \`llmConnector\` (required
|
|
197
|
-
- \`
|
|
198
|
-
- \`
|
|
216
|
+
- \`llmConnector\` (required) with \`ui.connectorCategories: [AI]\`
|
|
217
|
+
- \`mcpConnectors\` (optional - only if needed) with \`ui.component: array\`, \`ui.input.inputType: connector\`, and \`ui.input.inputConfig.connectorTypes: [Mcp]\`
|
|
218
|
+
- \`modelName\` (optional - **only** if user explicitly requests it)
|
|
199
219
|
- Custom inputs (as needed)
|
|
220
|
+
4. Add \`agent.layout\` block — only include items that are present as inputs:
|
|
221
|
+
- Always include \`llmConnector\`
|
|
222
|
+
- Include \`modelName\` only if that input exists
|
|
223
|
+
- Include \`mcpConnectors\` only if that input exists
|
|
200
224
|
|
|
201
225
|
**Always notify users to create connectors and replace placeholder IDs before running the agent.**
|
|
202
226
|
|
|
@@ -226,7 +250,7 @@ Parameters:
|
|
|
226
250
|
org_id: "<organization>"
|
|
227
251
|
project_id: "<project>"
|
|
228
252
|
body: {
|
|
229
|
-
uid: "<
|
|
253
|
+
uid: "<generated_from_agent_name>",
|
|
230
254
|
name: "<Agent Display Name>",
|
|
231
255
|
description: "<Brief description of agent purpose>",
|
|
232
256
|
spec: "<agent YAML spec as a string>",
|
|
@@ -235,10 +259,10 @@ Parameters:
|
|
|
235
259
|
\`\`\`
|
|
236
260
|
|
|
237
261
|
**Key fields for creation:**
|
|
238
|
-
- \`uid\` (required): Unique identifier.
|
|
262
|
+
- \`uid\` (required): Unique identifier. Always generate from \`name\` as \`ca_<slug>\` and send explicitly (e.g. "Code Coverage Agent" → \`ca_code_coverage_agent\`). Do not omit it or rely on API-side auto-generation.
|
|
239
263
|
- \`name\` (required): Display name for the agent
|
|
240
264
|
- \`description\` (optional): Brief description
|
|
241
|
-
- \`spec\` (required): The full agent YAML specification as a string (includes \`version: 1\`, \`agent:\`,
|
|
265
|
+
- \`spec\` (required): The full agent YAML specification as a string (includes \`version: 1\`, \`agent:\`, \`agent.step.group.steps\`, \`agent.inputs\`, and \`agent.layout\`)
|
|
242
266
|
- \`wiki\` (optional): Markdown documentation for the agent
|
|
243
267
|
|
|
244
268
|
### Updating an Existing Agent
|
|
@@ -247,7 +271,7 @@ Parameters:
|
|
|
247
271
|
Call MCP tool: harness_update
|
|
248
272
|
Parameters:
|
|
249
273
|
resource_type: "agent"
|
|
250
|
-
|
|
274
|
+
resource_id: "<agent_identifier>"
|
|
251
275
|
org_id: "<organization>"
|
|
252
276
|
project_id: "<project>"
|
|
253
277
|
body: {
|
|
@@ -272,44 +296,52 @@ Parameters:
|
|
|
272
296
|
version: 1
|
|
273
297
|
agent:
|
|
274
298
|
step:
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
299
|
+
group:
|
|
300
|
+
steps:
|
|
301
|
+
- name: Agent
|
|
302
|
+
if: <+Always>
|
|
303
|
+
id: agent
|
|
304
|
+
run:
|
|
305
|
+
container:
|
|
306
|
+
image: pkg.harness.io/vrvdt5ius7uwygso8s0bia/harness-agents/harness-ai-agent:latest
|
|
307
|
+
env:
|
|
308
|
+
PLUGIN_TASK: |
|
|
309
|
+
Review the pull request for repository \${{inputs.repo_name}} on branch \${{inputs.branch}}.
|
|
310
|
+
|
|
311
|
+
1. Analyze code changes for security vulnerabilities
|
|
312
|
+
2. Check for code quality issues
|
|
313
|
+
3. Verify test coverage
|
|
314
|
+
4. Post review comments using GitHub MCP tools
|
|
315
|
+
|
|
316
|
+
## RULES
|
|
317
|
+
- Focus on critical security issues first
|
|
318
|
+
- Be constructive in feedback
|
|
319
|
+
- Suggest specific code improvements
|
|
320
|
+
PLUGIN_MAX_TURNS: 150
|
|
321
|
+
PLUGIN_HARNESS_CONNECTOR: \${{inputs.llmConnector.id}}
|
|
322
|
+
PLUGIN_MCP_FORMAT: harness
|
|
323
|
+
PLUGIN_MCP_SERVERS: <+connectorInputs.resolveList(<+inputs.mcpConnectors>)>
|
|
297
324
|
|
|
298
325
|
inputs:
|
|
299
326
|
llmConnector:
|
|
300
327
|
type: connector
|
|
301
328
|
required: true
|
|
302
329
|
default: your_llm_connector_id # User must replace with actual connector ID
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
required: true
|
|
307
|
-
default: arn:aws:bedrock:us-east-1:587817102444:application-inference-profile/7p8sn93lhspw
|
|
330
|
+
ui:
|
|
331
|
+
connectorCategories:
|
|
332
|
+
- AI
|
|
308
333
|
|
|
309
334
|
mcpConnectors:
|
|
310
335
|
type: array
|
|
311
336
|
default:
|
|
312
337
|
- your_github_mcp_connector # User must replace with actual connector ID
|
|
338
|
+
ui:
|
|
339
|
+
component: array
|
|
340
|
+
input:
|
|
341
|
+
inputType: connector
|
|
342
|
+
inputConfig:
|
|
343
|
+
connectorTypes:
|
|
344
|
+
- Mcp
|
|
313
345
|
|
|
314
346
|
repo_name:
|
|
315
347
|
type: string
|
|
@@ -318,6 +350,12 @@ agent:
|
|
|
318
350
|
branch:
|
|
319
351
|
type: string
|
|
320
352
|
default: main
|
|
353
|
+
|
|
354
|
+
layout:
|
|
355
|
+
- title: Agent Configuration
|
|
356
|
+
items:
|
|
357
|
+
- llmConnector
|
|
358
|
+
- mcpConnectors
|
|
321
359
|
\`\`\`
|
|
322
360
|
|
|
323
361
|
---
|
|
@@ -328,27 +366,17 @@ agent:
|
|
|
328
366
|
|
|
329
367
|
| Guideline | Rule |
|
|
330
368
|
| ----------------------------| ------------------------------------------------------------------------------------------------------------------------------------------|
|
|
331
|
-
| **Check existing first** | Always call \`harness_list(resource_type="agent")\` to see if an existing agent can solve the use case before creating new
|
|
332
|
-
| **Updating agents** | Use \`harness_get\` to retrieve current config, then \`harness_update\` (not \`harness_create\`) to modify. Only custom agents can be updated.
|
|
333
|
-
| **
|
|
334
|
-
| **
|
|
335
|
-
| **
|
|
336
|
-
| **
|
|
337
|
-
| **
|
|
338
|
-
| **
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
## Best Practices
|
|
344
|
-
|
|
345
|
-
- Use \`type: connector\` for LLM and MCP access
|
|
346
|
-
- **Prefer inputs over environment variables** for all configuration
|
|
347
|
-
- Include meaningful descriptions on all inputs
|
|
348
|
-
- Provide detailed step-by-step instructions in \`task\` field with \`## RULES\` section
|
|
349
|
-
- Adjust \`max_turns\` based on task complexity (100-200)
|
|
350
|
-
- Always use placeholder connector IDs and notify users to replace them
|
|
351
|
-
- Create connectors via Harness UI or \`harness_create\` with \`resource_type="connector"\``
|
|
369
|
+
| **Check existing first** | Always call \`harness_list(resource_type="agent")\` to see if an existing agent can solve the use case before creating new |
|
|
370
|
+
| **Updating agents** | Use \`harness_get\` to retrieve current config, then \`harness_update\` (not \`harness_create\`) to modify. Only custom agents can be updated. |
|
|
371
|
+
| **Generate UID** | Always derive \`uid\` as \`ca_<slug>\` (e.g. "Code Coverage Agent" → \`ca_code_coverage_agent\`) — matches platform UI \`nameToUid()\`. Pass it explicitly; do not rely on create API fallback. |
|
|
372
|
+
| **Agent spec format** | The \`spec\` field uses \`agent.step.group.steps\` structure — the run step is nested inside a named group with \`name: Agent\`, \`if: <+Always>\`, \`id: agent\` |
|
|
373
|
+
| **Task in env** | Task instructions go in \`PLUGIN_TASK\` env var (multiline string). Max turns in \`PLUGIN_MAX_TURNS\`. There is no \`with:\` block. |
|
|
374
|
+
| **Expression syntax** | Use \`\${{inputs.fieldName}}\` inside env values. Use \`<+connectorInputs.resolveList(...)>\` for MCP server resolution. |
|
|
375
|
+
| **modelName is optional** | Do NOT add \`modelName\` input or \`ANTHROPIC_MODEL\` env var by default — only add when the user explicitly requests it |
|
|
376
|
+
| **Input defaults** | Every non-required input that is referenced via \`\${{inputs.fieldName}}\` **must have a \`default\` value** — omitting it causes a runtime error if the caller does not supply the value |
|
|
377
|
+
| **Connector placeholders** | Always use placeholders like \`your_llm_connector_id\` and \`your_mcp_connector_id\` and notify users to replace both LLM and MCP connector IDs with actual values before running the agent |
|
|
378
|
+
| **No clone/platform** | Do NOT add \`clone\`, \`platform\`, \`os\`, \`arch\`, or \`allowed_tools\` sections — agents are standalone with simplified structure |
|
|
379
|
+
| **Quality first** | Agent quality is paramount — verify YAML structure, validate all references, ensure complete task instructions before creating |`
|
|
352
380
|
}
|
|
353
381
|
}]
|
|
354
382
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-agent.js","sourceRoot":"","sources":["../../src/prompts/create-agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,MAAM,UAAU,yBAAyB,CAAC,MAAiB;IACzD,MAAM,CAAC,cAAc,CACnB,cAAc,EACd;QACE,WAAW,EAAE,6UAA6U;QAC1V,UAAU,EAAE;YACV,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;YAC5D,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;YACjE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC,CAAC,QAAQ,EAAE;YACjE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC,QAAQ,EAAE;SACjE;KACF,EACD,KAAK,EAAE,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC;QAC/D,QAAQ,EAAE,CAAC;gBACT,IAAI,EAAE,MAAe;gBACrB,OAAO,EAAE;oBACP,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE;;kBAEE,UAAU;YAChB,gBAAgB;aACf,MAAM,CAAC,CAAC,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cAAc,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE;;;;;;;;;;oFAUnB,MAAM,CAAC,CAAC,CAAC,kBAAkB,MAAM,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC,sBAAsB,UAAU,KAAK,CAAC,CAAC,CAAC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+MA6VsB;iBACtM;aACF,CAAC;KACH,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAA2C,MAAM,cAAc,CAAC;AACpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAe,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAClJ,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,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e,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,EAAE,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IAqC1H,yEAAyE;IACzE,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAwB3C"}
|
package/build/registry/index.js
CHANGED
|
@@ -39,6 +39,8 @@ import { freezeToolset } from "./toolsets/freeze.js";
|
|
|
39
39
|
import { overridesToolset } from "./toolsets/overrides.js";
|
|
40
40
|
import { aiEvalsToolset } from "./toolsets/ai-evals.js";
|
|
41
41
|
import { iacmToolset } from "./toolsets/iacm.js";
|
|
42
|
+
import { knowledgeGraphToolset } from "./toolsets/knowledge-graph.js";
|
|
43
|
+
import { semanticLayerToolset } from "./toolsets/semantic-layer.js";
|
|
42
44
|
import { ansibleToolset } from "./toolsets/ansible.js";
|
|
43
45
|
const log = createLogger("registry");
|
|
44
46
|
/** Keys under which different Harness APIs return list arrays. */
|
|
@@ -129,6 +131,8 @@ const ALL_TOOLSETS = [
|
|
|
129
131
|
overridesToolset,
|
|
130
132
|
aiEvalsToolset,
|
|
131
133
|
iacmToolset,
|
|
134
|
+
knowledgeGraphToolset,
|
|
135
|
+
semanticLayerToolset,
|
|
132
136
|
ansibleToolset,
|
|
133
137
|
];
|
|
134
138
|
/** All available toolset names — used by docs generation to discover opt-in toolsets. */
|