googleapis/mcp-toolbox · error

unable to initialize prompt %q: %w

Error message

unable to initialize prompt %q: %w

What it means

Error "unable to initialize prompt %q: %w" thrown in googleapis/mcp-toolbox.

Source

Thrown at internal/server/server.go:208

	toolsMap, err := initializeTools(ctx, cfg, sourcesMap, instrumentation, l)
	if err != nil {
		return nil, nil, nil, nil, nil, nil, err
	}

	// initialize and validate the prompts from configs
	promptsMap := make(map[string]prompts.Prompt)
	for name, pc := range cfg.PromptConfigs {
		p, err := func() (prompts.Prompt, error) {
			_, span := instrumentation.Tracer.Start(
				ctx,
				"toolbox/server/prompt/init",
				trace.WithAttributes(attribute.String("prompt_type", pc.PromptConfigType())),
				trace.WithAttributes(attribute.String("prompt_name", name)),
			)
			defer span.End()
			p, err := pc.Initialize()
			if err != nil {
				return nil, fmt.Errorf("unable to initialize prompt %q: %w", name, err)
			}
			return p, nil
		}()
		if err != nil {
			return nil, nil, nil, nil, nil, nil, err
		}
		promptsMap[name] = p
	}
	promptNames := make([]string, 0, len(promptsMap))
	for name := range promptsMap {
		promptNames = append(promptNames, name)
	}
	l.InfoContext(ctx, fmt.Sprintf("Initialized %d prompts: %s", len(promptsMap), strings.Join(promptNames, ", ")))

	groupsMap, err := initializeGroups(ctx, cfg, toolsMap, promptsMap, instrumentation, l)
	if err != nil {
		return nil, nil, nil, nil, nil, nil, err
	}

View on GitHub (pinned to 8cc6e09de2)

When it happens

Trigger: Thrown at internal/server/server.go:208 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/719866d2e4b7830f. Report an issue: GitHub.