Skip to content

Commit 00738aa

Browse files
Bruce Haumanclaude
andcommitted
Complete dry-run parameter implementation for clojure_edit tool
- Extract and pass dry-run parameter through validate-inputs - Enable dry-run modes: "diff" (returns diff) and "new-source" (returns complete source) - Both modes skip file write operations while preserving all other pipeline steps - Clean up debug logging 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a84a8f1 commit 00738aa

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/clojure_mcp/tools/form_edit/combined_edit_tool.clj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ Note: For `defmethod` forms, be sure to include the dispatch value (`area :recta
126126
;; Validate inputs implementation
127127
(defmethod tool-system/validate-inputs :clojure-edit-form [{:keys [nrepl-client-atom]} inputs]
128128
(let [file-path (validate-file-path inputs nrepl-client-atom)
129-
;; Accept form_identifier but map it to form_name internally for compatibility
130-
{:keys [form_identifier form_type operation content]} inputs
129+
{:keys [form_identifier form_type operation content dry-run]} inputs
131130
form_name form_identifier]
132131
(when-not form_identifier
133132
(throw (ex-info "Missing required parameter: form_identifier"
@@ -145,12 +144,12 @@ Note: For `defmethod` forms, be sure to include the dispatch value (`area :recta
145144
(when-not content
146145
(throw (ex-info "Missing required parameter: content"
147146
{:inputs inputs})))
148-
;; Return validated inputs with form_name for backward compatibility
149147
{:file_path file-path
150148
:form_name form_name
151149
:form_type form_type
152150
:operation operation
153-
:content content}))
151+
:content content
152+
:dry-run dry-run}))
154153

155154
;; Execute tool implementation
156155
(defmethod tool-system/execute-tool :clojure-edit-form [{:keys [nrepl-client-atom] :as tool} inputs]

src/clojure_mcp/tools/form_edit/pipeline.clj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,9 +600,7 @@
600600
format-source
601601
determine-file-type
602602
generate-diff
603-
;; Skip file operations if dry-run is set
604603
(fn [ctx]
605-
(log/info [:CONTEXT (pr-str (keys ctx))])
606604
(if (::dry-run ctx)
607605
ctx
608606
(-> ctx

0 commit comments

Comments
 (0)