Documentation
¶
Index ¶
- Constants
- func ParseCredentialEncryptionKey(value string) ([]byte, error)
- func PrepareRotatedCredential(appID, runID, serverID string, credential RunCredential, cfg RunConfig) ([]byte, error)
- func PrepareStoredServers(appID, runID string, requests []RunServerRequest, cfg RunConfig) ([]agentcore.RunMCPServer, error)
- func ProviderRegistrations(ctx context.Context, provider ToolProvider, prefix string) ([]tools.ProviderRegistration, []string, error)
- func RegisterProviderTools(ctx context.Context, registry *tools.Registry, provider ToolProvider, ...) ([]string, error)
- func RunToolAlias(serverName, toolName string) string
- type AuthenticationError
- type AuthenticationState
- type CallResult
- type ContentItem
- type FilteringProvider
- type Gateway
- type HTTPProvider
- type ProviderToolCallRequest
- type RunConfig
- type RunCredential
- type RunServerRequest
- type RunTool
- type StdioProvider
- type StreamableHTTPProvider
- type Tool
- type ToolCallRequest
- type ToolProvider
Constants ¶
const ( CredentialBearerToken = "bearer_token" CredentialHeaders = "headers" )
Variables ¶
This section is empty.
Functions ¶
func PrepareRotatedCredential ¶
func PrepareRotatedCredential(appID, runID, serverID string, credential RunCredential, cfg RunConfig) ([]byte, error)
PrepareRotatedCredential validates and encrypts a replacement credential for an existing run/server tuple. The tuple is authenticated as AES-GCM AAD, so ciphertext cannot be moved to another run or server record.
func PrepareStoredServers ¶
func PrepareStoredServers(appID, runID string, requests []RunServerRequest, cfg RunConfig) ([]agentcore.RunMCPServer, error)
func ProviderRegistrations ¶
func ProviderRegistrations(ctx context.Context, provider ToolProvider, prefix string) ([]tools.ProviderRegistration, []string, error)
ProviderRegistrations discovers and validates a provider catalog without mutating a registry.
func RegisterProviderTools ¶
func RunToolAlias ¶
Types ¶
type AuthenticationError ¶
AuthenticationError identifies a run-scoped MCP credential that must be replaced by the host app before the run can continue. It never contains the credential or a remote response body.
func (*AuthenticationError) Error ¶
func (e *AuthenticationError) Error() string
func (*AuthenticationError) Unwrap ¶
func (e *AuthenticationError) Unwrap() error
type AuthenticationState ¶
type AuthenticationState struct {
// contains filtered or unexported fields
}
AuthenticationState records an authentication failure raised after MCP initialization, including failures observed inside a tool call that an adapter may convert into model-visible tool output.
func PrepareRunTools ¶
func PrepareRunTools(ctx context.Context, store agentcore.Store, base *tools.Registry, appID, runID string, cfg RunConfig) (*tools.Registry, map[string]bool, *AuthenticationState, func(), error)
PrepareRunTools connects the run's MCP servers, verifies the app-authorized tools exist, and registers an isolated tool overlay. The returned close function must remain deferred through adapter execution.
func (*AuthenticationState) Failure ¶
func (s *AuthenticationState) Failure() *AuthenticationError
type CallResult ¶
type CallResult = sdk.ToolCallResult
type ContentItem ¶
type ContentItem = sdk.ContentItem
type FilteringProvider ¶
type FilteringProvider struct {
Provider ToolProvider
Allowed map[string]bool
}
func (FilteringProvider) CallTool ¶
func (p FilteringProvider) CallTool(ctx context.Context, name string, input json.RawMessage, meta tools.CommandExecutionContext) (*CallResult, error)
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
func NewGatewayWithAllowed ¶
func NewGatewayWithAllowed(store agentcore.Store, registry *tools.Registry, allowed map[string]bool) *Gateway
NewGatewayWithAllowed uses an execution-scoped allowlist. It is used for isolated run MCP overlays whose aliases do not belong to the saved agent.
func (*Gateway) CallTool ¶
func (g *Gateway) CallTool(ctx context.Context, appID, runID string, req ToolCallRequest) (*CallResult, error)
func (*Gateway) WithCallContext ¶
func (g *Gateway) WithCallContext(callContext tools.CallContext) *Gateway
WithCallContext adds execution-local resources, such as the staged skill root, without changing the persisted run or the public MCP contract.
type HTTPProvider ¶
func (HTTPProvider) CallTool ¶
func (p HTTPProvider) CallTool(ctx context.Context, name string, input json.RawMessage, meta tools.CommandExecutionContext) (*CallResult, error)
type ProviderToolCallRequest ¶
type ProviderToolCallRequest = sdk.ProviderToolCallRequest
type RunConfig ¶
type RunCredential ¶
type RunServerRequest ¶
type RunServerRequest struct {
ServerID string `json:"server_id"`
ServerName string `json:"server_name"`
Transport string `json:"transport"`
URL string `json:"url"`
Tools []RunTool `json:"tools"`
Skills []agentcore.SkillRef `json:"skills,omitempty"`
Credential *RunCredential `json:"credential,omitempty"`
}
type StdioProvider ¶
type StdioProvider struct {
Command string
Args []string
Env map[string]string
// contains filtered or unexported fields
}
func (*StdioProvider) CallTool ¶
func (p *StdioProvider) CallTool(ctx context.Context, name string, input json.RawMessage, meta tools.CommandExecutionContext) (*CallResult, error)
func (*StdioProvider) Close ¶
func (p *StdioProvider) Close() error
type StreamableHTTPProvider ¶
type StreamableHTTPProvider struct {
Endpoint string
Token string
Client *http.Client
// contains filtered or unexported fields
}
func (*StreamableHTTPProvider) CallTool ¶
func (p *StreamableHTTPProvider) CallTool(ctx context.Context, name string, input json.RawMessage, meta tools.CommandExecutionContext) (*CallResult, error)
type ToolCallRequest ¶
type ToolCallRequest struct {
ToolName string `json:"tool_name"`
Input json.RawMessage `json:"input"`
}
type ToolProvider ¶
type ToolProvider interface {
ListTools(ctx context.Context) ([]Tool, error)
CallTool(ctx context.Context, name string, input json.RawMessage, meta tools.CommandExecutionContext) (*CallResult, error)
}