From 9cbc7c8eb11dd5f8f46a1a2bddd938b31ecfe1ea Mon Sep 17 00:00:00 2001 From: Brandon Sheehy Date: Tue, 3 Feb 2026 10:28:38 -0600 Subject: [PATCH 1/2] exempt service call from using json --- internal/mcp/context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/mcp/context.go b/internal/mcp/context.go index 442e343..6542a92 100644 --- a/internal/mcp/context.go +++ b/internal/mcp/context.go @@ -134,7 +134,7 @@ func resolveServiceReferences(flags []Flag) []Flag { func applySmartDefaults(cmd string, args []string, flags []Flag) []Flag { // Add JSON output for list commands if not specified - if len(args) > 0 && args[0] == "list" && !hasFlag(flags, "json") { + if len(args) > 0 && args[0] == "list" && cmd != "service" && !hasFlag(flags, "json") { if globalContext.PreferredFormat == "json" || globalContext.PreferredFormat == "" { flags = append(flags, Flag{Name: "json", Value: ""}) } From fc95d21a5a684e2c33fa01d7c9b37a4c3bf68d56 Mon Sep 17 00:00:00 2001 From: Brandon Sheehy Date: Tue, 3 Feb 2026 11:09:03 -0600 Subject: [PATCH 2/2] updated tests to account for service list json change --- internal/mcp/context_test.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/internal/mcp/context_test.go b/internal/mcp/context_test.go index d1cc0c1..ce060f2 100644 --- a/internal/mcp/context_test.go +++ b/internal/mcp/context_test.go @@ -316,8 +316,8 @@ func TestApplySmartDefaults(t *testing.T) { }, }, { - name: "adds json flag for list commands", - cmd: "service", + name: "adds json flag for non-service list commands", + cmd: "kv-store", args: []string{"list"}, inputFlags: []Flag{}, checkFunc: func(t *testing.T, flags []Flag) { @@ -326,6 +326,17 @@ func TestApplySmartDefaults(t *testing.T) { } }, }, + { + name: "does not add json flag for service list commands", + cmd: "service", + args: []string{"list"}, + inputFlags: []Flag{}, + checkFunc: func(t *testing.T, flags []Flag) { + if hasFlag(flags, "json") { + t.Error("Expected json flag not to be added for service list command") + } + }, + }, } for _, tt := range tests {