From c078c2f8f91a5aa3f411399e9f2aab6d3f9208e4 Mon Sep 17 00:00:00 2001 From: Amolith Date: Sun, 14 Jun 2026 22:57:14 -0600 Subject: [PATCH] mcp: remove edit permission from recipe read output --- internal/mcp/server.go | 23 ++++++++++------------- internal/mcp/server_test.go | 8 ++------ 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/internal/mcp/server.go b/internal/mcp/server.go index e0399ab139f85724cf7b1d37078497b88c5532c5..57ac6f44fc1bc4f49a1509121391ca6a0eda52ce 100644 --- a/internal/mcp/server.go +++ b/internal/mcp/server.go @@ -134,12 +134,11 @@ func (s *Server) callRecipeReadTool(ctx context.Context, rawRecipeID string) (*s } recipe := RecipeDetail{ - ID: recipeID, - Title: metadata.Title, - Owner: metadata.Owner, - EditPermission: metadata.EditPermission, - Content: content.Content, - Portions: content.Portions, + ID: recipeID, + Title: metadata.Title, + Owner: metadata.Owner, + Content: content.Content, + Portions: content.Portions, } output := ReadOutput{Recipe: &recipe} @@ -998,7 +997,6 @@ func formatRecipe(recipe RecipeDetail) string { builder.WriteString(recipe.Owner) builder.WriteByte('\n') } - fmt.Fprintf(&builder, "Edit permission: %t\n", recipe.EditPermission) fmt.Fprintf(&builder, "Portions: %s\n", formatPortions(recipe.Portions)) content := strings.TrimSpace(recipe.Content) @@ -1103,12 +1101,11 @@ type RecipeSummary struct { // RecipeDetail is the MCP-safe single recipe output. type RecipeDetail struct { - ID string `json:"id"` - Title string `json:"title"` - Owner string `json:"owner"` - EditPermission bool `json:"edit_permission"` - Content string `json:"content"` - Portions float64 `json:"portions"` + ID string `json:"id"` + Title string `json:"title"` + Owner string `json:"owner"` + Content string `json:"content"` + Portions float64 `json:"portions"` } // PreviewRecipeTextArguments contains preview_recipe_text tool arguments. diff --git a/internal/mcp/server_test.go b/internal/mcp/server_test.go index 3aec8779fad8326b4c2f5ac2c32833d2e9211efc..7642516394564030a2671ab09b23ff237e2fe199 100644 --- a/internal/mcp/server_test.go +++ b/internal/mcp/server_test.go @@ -173,12 +173,8 @@ func requireSingleRecipeOutput(t *testing.T, output ReadOutput) { if output.Recipe.ID != "recipe-1" || output.Recipe.Title != "Pasta" { t.Fatalf("structured recipe identity = %#v, want recipe-1 Pasta", output.Recipe) } - if output.Recipe.Owner != "returned-user" || !output.Recipe.EditPermission { - t.Fatalf( - "structured recipe owner/edit = %q/%v, want returned-user/true", - output.Recipe.Owner, - output.Recipe.EditPermission, - ) + if output.Recipe.Owner != "returned-user" { + t.Fatalf("structured recipe owner = %q, want returned-user", output.Recipe.Owner) } if output.Recipe.Content != "# Pasta\n\n- 200g pasta\n\n1. Boil pasta." || output.Recipe.Portions != 1.5 { t.Fatalf(