Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions Sources/MCP/Base/Annotations.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import Foundation

/// The sender or recipient of messages and data in a conversation.
public enum Role: String, Hashable, Codable, Sendable {
/// A user message
case user
/// An assistant message
case assistant
}

/// Optional annotations for content, used to inform how objects are used or displayed.
///
/// - SeeAlso: https://modelcontextprotocol.io/specification/2025-11-25/schema#annotations
public struct Annotations: Hashable, Codable, Sendable {
// TODO: Deprecate in a future version
/// Backwards compatibility alias for top-level `Role`.
public typealias Role = MCP.Role

/// Describes who the intended audience of this object or data is.
/// It can include multiple entries to indicate content useful for multiple audiences.
public var audience: [Role]?

/// Describes how important this data is for operating the server.
/// A value of 1 means "most important" (effectively required),
/// while 0 means "least important" (entirely optional).
public var priority: Double?

/// The moment the resource was last modified, as an ISO 8601 formatted string.
public var lastModified: String?

public init(
audience: [Role]? = nil,
priority: Double? = nil,
lastModified: String? = nil
) {
self.audience = audience
self.priority = priority
self.lastModified = lastModified
}
}
Loading