feat: add diagnose_deployment_failure and add_release_notes prompts - #101
feat: add diagnose_deployment_failure and add_release_notes prompts#101egorpavlikhin wants to merge 1 commit into
Conversation
akirayamamoto
left a comment
There was a problem hiding this comment.
I left some comments there, happy to discuss.
| const qualifierClause = | ||
| qualifiers.length > 0 ? ` (${qualifiers.join(", ")})` : ""; | ||
|
|
||
| const text = `Diagnose the most recent failed ${subject} for project **${projectName}** in space **${spaceName}**${qualifierClause}. |
There was a problem hiding this comment.
What if the one I want to diagnose is not the most recently failed? For example, not the lastest runbook run? It could be an intermittent one.
It could be possible for a release as well but less likely.
| Follow this diagnostic approach, thinking step-by-step: | ||
| 1. Identify the exact step/target where failure occurred. | ||
| 2. Extract and quote the specific error message(s) from the task log. | ||
| 3. Determine the error category (configuration, connectivity, permissions, resource availability, etc.). |
There was a problem hiding this comment.
Leaving the range of category open (and not well defined) could lead to unpredictable results, therefore, I wonder if extracting a category here is useful. Maybe we are looking for a summary?
|
|
||
| Remember: releases in Octopus snapshot the deployment process and variables at creation time. Changes made afterwards do not affect existing releases — fixes usually require creating a new release. | ||
|
|
||
| Follow the Octopus Deploy writing guide: be concise, direct, and use plain English. Bold step/project/entity names, quote log lines in code blocks, and avoid speculation about manually-cancelled tasks.`; |
There was a problem hiding this comment.
"Follow the Octopus Deploy writing guide" is this guide available in the MCP server? If not it could be dropped.
|
|
||
| export function registerAddReleaseNotesPrompt(server: McpServer) { | ||
| server.registerPrompt( | ||
| "add_release_notes", |
There was a problem hiding this comment.
I think this would be more predictable if we split the workflow into draft_release_notes and set_release_notes.
draft_release_notes should be a non-mutating prompt: take explicit source material, like PRs, commits, tickets, or a user-provided changelog, and return a draft for review.
set_release_notes should probably be a tool, not a prompt. Updating ReleaseNotes is a concrete Octopus write operation, so it benefits from typed inputs, validation, confirmation, tests, and deterministic behavior. It should update an existing release only and not fall back to creating one.
For creating releases, I’d use the existing create_release tool and recommend passing releaseNotes there when needed. That tool already supports release notes, so a separate “create release with notes” prompt would duplicate behavior.
This keeps the boundaries clearer:
- draft notes: prompt, no side effects
- set notes on an existing release: tool, write operation
- create a release with notes: existing
create_releasetool
The current add_release_notes prompt mixes drafting, release selection, updating, and fallback creation in one flow. That makes the outcome harder to predict, especially when releaseVersion is omitted or the release is not found.
Summary
Adds the first two MCP prompts to the server, registered alongside tools and resources:
diagnose_deployment_failure— walks the LLM through analyzing a failed deployment or runbook run: locate the failed task, extract the specific error, categorize it, suggest remediation. Points at the relevant tools (find_releases/find_runbooks,list_deployments,get_task_from_url,read_resourcefor the task activity tree,grep_task_log,find_events) and reminds about release snapshotting.add_release_notes— guides the LLM through summarizing a change set into a Markdown changelog and writing it to an existing release via thePUT /releases/{id}round-trip (read full body → swapReleaseNotes→ PUT back), with acreate_releasefallback when no matching release exists. Flags Octostache non-re-evaluation andReleaseEditpermission gotchas.Both prompts require
spaceNameandprojectName; release version / runbook name are optional and steer behavior. Wired intosrc/index.tsvia a newregisterPromptsbarrel mirroring the tool/resource registration pattern.Test plan
npm run build)npm run lint)prompts/listdiagnose_deployment_failureagainst a known failed deployment and confirm the LLM follows the prescribed tool pathadd_release_notesend-to-end: draft notes, PUT round-trip, verify onlyReleaseNoteschanged on the releaseadd_release_notesagainst a non-existent release version and confirm thecreate_releasefallback engages