googleapis/mcp-toolbox · error

could not read response: %w

Error message

could not read response: %w

What it means

Error "could not read response: %w" thrown in googleapis/mcp-toolbox.

Source

Thrown at internal/sources/cloudhealthcare/cloud_healthcare.go:279

	return ok
}

func (s *Source) IsDICOMStoreAllowed(storeID string) bool {
	if len(s.allowedDICOMStores) == 0 {
		return true
	}
	_, ok := s.allowedDICOMStores[storeID]
	return ok
}

func (s *Source) UseClientAuthorization() bool {
	return s.UseClientOAuth
}

func parseResults(resp *http.Response) (any, error) {
	respBytes, err := io.ReadAll(resp.Body)
	if err != nil {
		return nil, fmt.Errorf("could not read response: %w", err)
	}
	if resp.StatusCode > 299 {
		return nil, fmt.Errorf("status %d %s: %s", resp.StatusCode, resp.Status, respBytes)
	}
	var jsonMap map[string]interface{}
	if err := json.Unmarshal(respBytes, &jsonMap); err != nil {
		return nil, fmt.Errorf("could not unmarshal response as json: %w", err)
	}
	return jsonMap, nil
}

func (s *Source) getService(tokenStr string) (*healthcare.Service, error) {
	svc := s.Service()
	var err error
	// Initialize new service if using user OAuth token
	if s.UseClientAuthorization() {
		svc, err = s.ServiceCreator()(tokenStr)
		if err != nil {

View on GitHub (pinned to 8cc6e09de2)

When it happens

Trigger: Thrown at internal/sources/cloudhealthcare/cloud_healthcare.go:279 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/eac78b134cbffb74. Report an issue: GitHub.