mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-07 06:59:59 +08:00
chore: optimize mcp (#4866)
This commit is contained in:
@@ -809,7 +809,7 @@ func (s *sseMcpServer) processResourcesRead(ctx context.Context, client *mcpClie
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Ensure MimeType is set if available from the resource definition
|
// Ensure MimeType is set if available from the resource definition
|
||||||
if len(content.MimeType) == 0 && resource.MimeType != "" {
|
if len(content.MimeType) == 0 && len(resource.MimeType) > 0 {
|
||||||
content.MimeType = resource.MimeType
|
content.MimeType = resource.MimeType
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -116,13 +116,8 @@ type FileContent struct {
|
|||||||
|
|
||||||
// EmbeddedResource represents a resource embedded in a message
|
// EmbeddedResource represents a resource embedded in a message
|
||||||
type EmbeddedResource struct {
|
type EmbeddedResource struct {
|
||||||
Type string `json:"type"` // Always "resource"
|
Type string `json:"type"` // Always "resource"
|
||||||
Resource struct {
|
Resource ResourceContent `json:"resource"` // The resource data
|
||||||
URI string `json:"uri"` // Resource URI
|
|
||||||
MimeType string `json:"mimeType"` // MIME type of the resource
|
|
||||||
Text string `json:"text,omitempty"` // Text content (if available)
|
|
||||||
Blob string `json:"blob,omitempty"` // Base64 encoded blob data (if available)
|
|
||||||
} `json:"resource"` // The resource data
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Annotations provides additional metadata for content
|
// Annotations provides additional metadata for content
|
||||||
|
|||||||
Reference in New Issue
Block a user