From e8d0656fc67b315e9427dc146e752415d8fb2e62 Mon Sep 17 00:00:00 2001 From: James Date: Mon, 9 Feb 2026 14:50:20 -0500 Subject: [PATCH] fix: return category names instead of category keys in v1 API Changed v1Entries and v1Entry to return category names ('genome', 'upload') instead of keys ('category004', 'category005'). This makes the API consistent and prevents MCP from passing back the wrong format. Removed category004 format parsing since API no longer returns it. Co-Authored-By: Claude Sonnet 4.5 --- api/api_v1.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/api/api_v1.go b/api/api_v1.go index ae44073..94e8b5c 100644 --- a/api/api_v1.go +++ b/api/api_v1.go @@ -234,14 +234,7 @@ func v1Entries(w http.ResponseWriter, r *http.Request, dossierID string) { parentID := q.Get("parent") category := 0 if cat := q.Get("category"); cat != "" { - // Support both "genome" and "category004" formats - if strings.HasPrefix(cat, "category") { - // Parse "category004" -> 4 - fmt.Sscanf(cat, "category%d", &category) - } else { - // Parse name like "genome", "upload", etc. - category = lib.CategoryFromString[cat] - } + category = lib.CategoryFromString[cat] } filter := &lib.EntryFilter{ DossierID: dossierID, @@ -269,7 +262,7 @@ func v1Entries(w http.ResponseWriter, r *http.Request, dossierID string) { entry := map[string]any{ "id": e.EntryID, "parent_id": e.ParentID, - "category": lib.CategoryKey(e.Category), + "category": lib.CategoryName(e.Category), "type": e.Type, "summary": e.Summary, "ordinal": e.Ordinal, @@ -313,7 +306,7 @@ func v1Entry(w http.ResponseWriter, r *http.Request, dossierID, entryID string) entry := map[string]any{ "id": e.EntryID, "parent_id": e.ParentID, - "category": lib.CategoryKey(e.Category), + "category": lib.CategoryName(e.Category), "type": e.Type, "summary": e.Summary, "ordinal": e.Ordinal,