Versions in this module Expand all Collapse all v0 v0.5.0 Nov 24, 2026 Changes in this version type Handler + Log *slog.Logger v0.4.0 Nov 19, 2026 Changes in this version + const DefaultTTLMS + const OAuthClientCredentialsExtension + const ProtocolVersion + const SkillsExtension + const ToolErrorCodeMetaKey + var SDKAPI = apispec.Config[string] + func AddHeaderToProperty(schema *jsonschema.Schema, property, header string) + func DecodeToolArgument[T any](data json.RawMessage) (T, error) + func ErrInvalidParams(format string, args ...any) error + func SchemaFor[T any]() *jsonschema.Schema + func ValidateToolSchema(schema *jsonschema.Schema) error + type Annotations struct + Audience []Role + LastModified string + Priority *int + func (a Annotations) IsZero() bool + type CacheScope string + const CacheScopePrivate + const CacheScopePublic + type Capabilities struct + Completions MetaObject + DeprecatedLogging MetaObject + Experimental Extensions + Extensions Extensions + Prompts *PromptsCapability + Resources ResourcesCapability + Tools ToolsCapability + type ClientCapabilities struct + DeprecatedRoots MetaObject + DeprecatedSampling *SamplingCapability + Elicitation *ElicitationCapability + Experimental Extensions + Extensions Extensions + type ContentBlock struct + Annotations Annotations + Data string + Description string + Icons []Icon + Meta MetaObject + MimeType string + Name string + Resource ResourceContent + Size int64 + Text string + Title string + Type ContentType + URI string + func (c *ContentBlock) Validate() error + type ContentType string + const ContentTypeAudio + const ContentTypeImage + const ContentTypeResource + const ContentTypeResourceLink + const ContentTypeText + type ElicitationCapability struct + Form MetaObject + URL MetaObject + type ErrorCode int + const InternalErrorCode + const InvalidParamsCode + const InvalidRequestCode + const MethodNotFoundCode + const MissingRequiredClientCapabilityCode + const ParseErrorCode + const UnsupportedProtocolVersionCode + type ErrorOutput struct + Error string + type Extensions map[string]json.RawMessage + type Handler struct + OAuthClientCredentials bool + Registry Registry + ServerInfo Implementation + Sessions *SessionStore + func (h *Handler) HandleMCP(w http.ResponseWriter, r *http.Request) + type HeaderParam struct + Header string + Path []string + func HeaderParams(schema *jsonschema.Schema) ([]HeaderParam, error) + type Icon struct + MimeType string + Sizes []string + Src string + Theme string + type Implementation struct + Description string + Icons []Icon + Name string + Title string + Version string + WebsiteURL string + type JSONRPCError struct + Code ErrorCode + Data any + Message string + type JSONRPCNotification struct + JSONRPC string + Method NotificationMethod + Params any + type JSONRPCRequest struct + ID json.RawMessage + JSONRPC string + Method Method + Params json.RawMessage + type JSONRPCResponse struct + Error *JSONRPCError + ID json.RawMessage + JSONRPC string + Result any + type MetaObject map[string]any + type Method string + const MethodResourceTemplatesList + const MethodResourcesList + const MethodResourcesRead + const MethodServerDiscover + const MethodSkillsGet + const MethodSkillsList + const MethodSubscriptionsListen + const MethodToolsCall + const MethodToolsList + type NotificationMethod string + const NotificationMethodResourcesListChanged + const NotificationMethodResourcesUpdated + const NotificationMethodSubscriptionsAcknowledged + const NotificationMethodSubscriptionsInitialState + type OpenAIRequestMeta struct + Locale string + Organization string + Session string + Subject string + UserAgent string + UserLocation OpenAIUserLocation + type OpenAIUserLocation struct + Timezone string + type PaginatedRequestParams struct + Cursor string + Meta RequestMeta + type PromptsCapability struct + ListChanged bool + type RawToolResult struct + IsError bool + Meta MetaObject + Structured any + type Registry interface + CallTool func(ctx context.Context, params *ToolsCallParams) (RawToolResult, error) + Instructions func(ctx context.Context, meta *RequestMeta) (string, error) + ListResources func(ctx context.Context, cursor string) (ResourcesListResult, error) + ReadResource func(ctx context.Context, params *ResourcesReadParams) (ResourcesReadResult, error) + Resources func(ctx context.Context) iter.Seq2[ResourceDescriptor, error] + Tools func(ctx context.Context) ([]ToolDescriptor, error) + type RequestMeta struct + ClientCapabilities ClientCapabilities + ClientInfo Implementation + DeprecatedLogLevel string + Extra MetaObject + ProgressToken any + ProtocolVersion string + func (m *RequestMeta) UnmarshalJSON(data []byte) error + func (m RequestMeta) MarshalJSON() ([]byte, error) + type RequestParams struct + Meta RequestMeta + type ResourceContent struct + Blob string + Meta MetaObject + MimeType string + Text string + URI string + func (r ResourceContent) IsZero() bool + func (r ResourceContent) Validate() error + type ResourceDescriptor struct + Annotations *Annotations + Description string + Icons []Icon + Meta MetaObject + MimeType string + Name string + Size int64 + Title string + URI string + type ResourceLink struct + Description string + Icons []Icon + MimeType string + Name string + Size int64 + Title string + Type ContentType + URI string + func (r ResourceLink) MarshalJSON() ([]byte, error) + type ResourceTemplateDescriptor struct + Annotations *Annotations + Description string + Icons []Icon + Meta MetaObject + MimeType string + Name string + Title string + URITemplate string + type ResourceTemplatesListResult struct + CacheScope CacheScope + Meta MetaObject + NextCursor string + ResourceTemplates []ResourceTemplateDescriptor + ResultType ResultType + TTLMS int + type ResourceTemplatesRegistry interface + ResourceTemplates func(ctx context.Context) ([]ResourceTemplateDescriptor, error) + type ResourceUpdate struct + KeepAlive bool + ResourceURIs []string + ResourcesListChanged bool + type ResourcesCapability struct + ListChanged bool + Subscribe bool + type ResourcesListResult struct + CacheScope CacheScope + Meta MetaObject + NextCursor string + Resources []ResourceDescriptor + ResultType ResultType + TTLMS int + type ResourcesReadParams struct + InputResponses json.RawMessage + Meta RequestMeta + RequestState string + URI string + type ResourcesReadResult struct + CacheScope CacheScope + Contents []ResourceContent + Meta MetaObject + ResultType ResultType + TTLMS int + func ResourceJSON(uri string, value any) (ResourcesReadResult, error) + type ResultType string + const ResultTypeComplete + type Role string + const RoleAssistant + const RoleUser + type SamplingCapability struct + Context MetaObject + Tools MetaObject + type ServerDiscoverResult struct + CacheScope CacheScope + Capabilities Capabilities + Instructions string + ResultType ResultType + ServerInfo Implementation + SupportedVersions []string + TTLMS int + type SessionStore struct + func NewSessionStore(owner func(context.Context) (string, error)) *SessionStore + type Skill struct + Frontmatter map[string]any + Resources []SkillResource + URI string + type SkillResource struct + Digest string + Size int64 + URI string + type SkillsGetParams struct + Meta RequestMeta + URI string + type SkillsGetResult struct + CacheScope CacheScope + Meta MetaObject + ResultType ResultType + Skill Skill + TTLMS int + type SkillsListResult struct + CacheScope CacheScope + Meta MetaObject + NextCursor string + ResultType ResultType + Skills []Skill + TTLMS int + type SkillsRegistry interface + GetSkill func(ctx context.Context, uri string) (SkillsGetResult, error) + ListSkills func(ctx context.Context, cursor string) (SkillsListResult, error) + type SubscriptionFilter struct + ResourceSubscriptions []string + ResourcesListChanged bool + type SubscriptionNotificationParams struct + Meta MetaObject + Notifications *SubscriptionFilter + URI string + type SubscriptionRegistry interface + SubscribeResourceUpdates func(ctx context.Context, params *SubscriptionsListenParams) (iter.Seq2[ResourceUpdate, error], error) + type SubscriptionsInitialStateParams struct + Contents []ResourceContent + Meta MetaObject + URI string + type SubscriptionsListenParams struct + Meta RequestMeta + Notifications SubscriptionFilter + type TextOutput struct + Result string + type ToolAnnotations struct + DestructiveHint bool + IdempotentHint bool + OpenWorldHint bool + ReadOnlyHint bool + Title string + type ToolCallResult struct + Content []ContentBlock + IsError bool + Meta MetaObject + ResultType ResultType + StructuredContent any + type ToolDescriptor struct + Annotations *ToolAnnotations + Description string + Icons []Icon + InputSchema *jsonschema.Schema + Meta MetaObject + Name string + OutputSchema *jsonschema.Schema + Title string + type ToolHandler func(context.Context, *ToolsCallParams) (RawToolResult, error) + type ToolRequest struct + Arguments T + Params RequestParams + type ToolResult struct + IsError bool + Meta MetaObject + Structured any + func TextToolResult(message string) ToolResult[TextOutput] + func ToolErrorWithMeta[T any](message string, meta MetaObject) ToolResult[T] + func ToolError[T any](message string) ToolResult[T] + func TypedToolResult[T any](structured T) ToolResult[T] + type ToolSpec struct + Annotations *ToolAnnotations + Description string + Handler ToolHandler + InputSchema *jsonschema.Schema + Name string + OutputSchema *jsonschema.Schema + Title string + func NewToolSpec[In, Out any](name, title, description string, ...) ToolSpec + type ToolsCallParams struct + Arguments json.RawMessage + InputResponses json.RawMessage + Meta RequestMeta + Name string + RequestState string + type ToolsCapability struct + ListChanged bool + type ToolsListResult struct + CacheScope CacheScope + Meta MetaObject + NextCursor string + ResultType ResultType + TTLMS int + Tools []ToolDescriptor