googleapis/mcp-toolbox · error

invalid toolbox-url %q: %w

Error message

invalid toolbox-url %q: %w

What it means

Error "invalid toolbox-url %q: %w" thrown in googleapis/mcp-toolbox.

Source

Thrown at internal/server/prm.go:89

	// OPTIONAL. A JWT containing metadata parameters about the protected resource
	// as claims. Consists of the entire signed JWT string.
	SignedMetadata string `json:"signed_metadata,omitempty"`
}

// getPRMURL returns the full URL to advertise in WWW-Authenticate headers.
func (s *Server) getPRMURL() string {
	return s.prmURL
}

// parsePRMURL returns the full URL to advertise in WWW-Authenticate headers from a toolbox URL.
func parsePRMURL(toolboxUrl string) (string, error) {
	if toolboxUrl == "" {
		return "/.well-known/oauth-protected-resource", nil
	}
	u, err := url.Parse(toolboxUrl)
	if err != nil {
		return "", fmt.Errorf("invalid toolbox-url %q: %w", toolboxUrl, err)
	}
	if u.Scheme != "" || u.Host != "" {
		if u.Scheme == "" || u.Host == "" {
			return "", fmt.Errorf("invalid toolbox-url %q: must be a valid absolute URL with scheme and host", toolboxUrl)
		}
		path := strings.TrimSuffix(u.Path, "/")
		return u.Scheme + "://" + u.Host + "/.well-known/oauth-protected-resource" + path, nil
	}
	path := strings.TrimSuffix(u.Path, "/")
	if !strings.HasPrefix(path, "/") {
		path = "/" + path
	}
	if path == "/" {
		return "/.well-known/oauth-protected-resource", nil
	}
	return "/.well-known/oauth-protected-resource" + path, nil
}

View on GitHub (pinned to 8cc6e09de2)

When it happens

Trigger: Thrown at internal/server/prm.go:89 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05). Data as JSON: /api/errors/772309c32b35092e. Report an issue: GitHub.