Context helper to skip interactive prompts and handle OAuth authorization errors in Go projects.
// Source: https://github.com/docker/docker-agent | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
package tools
import (
"context"
"errors"
)
// noInteractivePromptsKey is the unexported key used to attach the
// "skip interactive prompts" flag to a context.
type noInteractivePromptsKey struct{}
// WithoutInteractivePrompts returns a context that asks the MCP transport
// stack to refuse any flow that would require user input. The canonical
// example is OAuth: a remote MCP server's first contact is typically a 401
// Unauthorized that triggers an interactive elicitation flow ("approve OAuth
// authorization?"). During startup the TUI is not yet ready to surface that
// dialo
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key