From 67e85e19ae0c3a0558a92cf787a730187fcb02ea Mon Sep 17 00:00:00 2001 From: OpenWaygate <27287694+OpenWaygate@users.noreply.github.com> Date: Sun, 3 Aug 2025 20:46:37 +0800 Subject: [PATCH] :recycle: Extract json mime issue #64 --- cmd/constants.go | 1 + cmd/i18nLanguage/list.go | 4 ++-- cmd/i18nRegion/list.go | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/constants.go b/cmd/constants.go index e72e6f6..c6f6856 100644 --- a/cmd/constants.go +++ b/cmd/constants.go @@ -6,4 +6,5 @@ const ( TableUsage = "json, yaml, or table" SilentUsage = "json, yaml, or silent" JPUsage = "JSONPath expression to filter the output" + JsonMIME = "application/json" ) diff --git a/cmd/i18nLanguage/list.go b/cmd/i18nLanguage/list.go index d732a04..20d653e 100644 --- a/cmd/i18nLanguage/list.go +++ b/cmd/i18nLanguage/list.go @@ -84,7 +84,7 @@ func listHandler( var allI18nLanguages = mcp.NewResource( rURI, rName, - mcp.WithMIMEType("application/json"), + mcp.WithMIMEType(cmd.JsonMIME), mcp.WithResourceDescription(long), ) @@ -102,7 +102,7 @@ func resourceHandler( contents := []mcp.ResourceContents{ mcp.TextResourceContents{ URI: rURI, - MIMEType: "application/json", + MIMEType: cmd.JsonMIME, Text: writer.String(), }, } diff --git a/cmd/i18nRegion/list.go b/cmd/i18nRegion/list.go index f4cbe62..d3f3bee 100644 --- a/cmd/i18nRegion/list.go +++ b/cmd/i18nRegion/list.go @@ -84,7 +84,7 @@ func listHandler( var alli18nRegion = mcp.NewResource( rURI, rName, - mcp.WithMIMEType("application/json"), + mcp.WithMIMEType(cmd.JsonMIME), mcp.WithResourceDescription(long), ) @@ -102,7 +102,7 @@ func resourceHandler( contents := []mcp.ResourceContents{ mcp.TextResourceContents{ URI: rURI, - MIMEType: "application/json", + MIMEType: cmd.JsonMIME, Text: writer.String(), }, }