Documentation
¶
Overview ¶
Package mcpcontract owns Scenery's provider-neutral MCP capability manifest and the wire values exchanged across the private gateway dispatch boundary.
Index ¶
- Constants
- Variables
- func Digest(manifest Manifest) (string, error)
- func MarshalCanonical(manifest Manifest) ([]byte, error)
- func MarshalOutcome(outcome ToolOutcome) ([]byte, error)
- type Approval
- type Auth
- type CancelResult
- type Capability
- type Connection
- type DeclaredProblem
- type DurableReceipt
- type Effect
- type ExecutionStatus
- type Limits
- type Manifest
- type Origin
- type ToolCallContext
- type ToolDispatcher
- type ToolOutcome
Constants ¶
View Source
const ( ManifestKind = "scenery.mcp-capability-manifest" ProtocolVersion = "2025-11-25" StatusToolName = "scenery_execution_status" CancelToolName = "scenery_execution_cancel" ToolNamePattern = `^[a-z][a-z0-9_]{0,127}$` MaximumInputBytes = 16 << 20 MaximumResultBytes = 16 << 20 )
Variables ¶
View Source
var ManifestSchemaRevision = string(spec.SchemaRevision(manifestSchemaDescriptor))
Functions ¶
func MarshalCanonical ¶
func MarshalOutcome ¶
func MarshalOutcome(outcome ToolOutcome) ([]byte, error)
Types ¶
type CancelResult ¶
type Capability ¶
type Capability struct {
ID string `json:"id"`
Name string `json:"name"`
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
InputSchema json.RawMessage `json:"input_schema"`
OutputSchema json.RawMessage `json:"output_schema"`
OperationAddress string `json:"operation_address"`
ExecutionAddress string `json:"execution_address"`
Origin Origin `json:"origin"`
Auth Auth `json:"auth"`
Limits Limits `json:"limits"`
Effect Effect `json:"effect"`
Approval Approval `json:"approval"`
Durable bool `json:"durable"`
AllowSensitiveOutput bool `json:"allow_sensitive_output"`
}
type Connection ¶
type Connection struct {
Address string `json:"address"`
Namespace string `json:"namespace"`
Required bool `json:"required"`
Allow []string `json:"allow,omitempty"`
Block []string `json:"block,omitempty"`
}
Connection identifies a federated capability source without carrying its URL, authentication material, or any provider-specific configuration.
type DeclaredProblem ¶
type DeclaredProblem struct {
Code string `json:"code"`
Message string `json:"message"`
Path string `json:"path,omitempty"`
Details json.RawMessage `json:"details,omitempty"`
}
type DurableReceipt ¶
type ExecutionStatus ¶
type ExecutionStatus struct {
ExecutionID string `json:"execution_id"`
State string `json:"state"`
Outcome json.RawMessage `json:"outcome,omitempty"`
}
type Manifest ¶
type Manifest struct {
Kind string `json:"kind"`
SchemaRevision string `json:"schema_revision"`
ProtocolVersion string `json:"protocol_version"`
SourceRevision string `json:"source_revision,omitempty"`
ContractRevision string `json:"contract_revision"`
ImplementationRevision string `json:"implementation_revision,omitempty"`
Capabilities []Capability `json:"capabilities"`
Connections []Connection `json:"connections"`
}
type ToolCallContext ¶
type ToolCallContext struct {
Principal string `json:"principal"`
AssistantAddress string `json:"assistant_address"`
ConversationDigest string `json:"conversation_digest"`
CapabilityRevision string `json:"capability_revision"`
RequestID string `json:"request_id"`
TraceContext map[string]string `json:"trace_context,omitempty"`
IdempotencyKey string `json:"idempotency_key,omitempty"`
}
ToolCallContext is derived from a short-lived private assertion. Principal is a Scenery identity, never an application bearer token or external secret.
type ToolDispatcher ¶
type ToolDispatcher interface {
CallTool(context.Context, ToolCallContext, string, json.RawMessage) (ToolOutcome, error)
}
type ToolOutcome ¶
type ToolOutcome struct {
Outcome string `json:"outcome"`
Value json.RawMessage `json:"value,omitempty"`
Problem json.RawMessage `json:"problem,omitempty"`
Receipt *DurableReceipt `json:"receipt,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.