github/copilot-sdk · error

invalid entry : there is no bare wildcard. Use one or more…

Error message

invalid %s entry %q: there is no bare wildcard. Use one or more of NewToolSet().AddBuiltIn("*"), .AddMCP("*"), or .AddCustom("*") to target a specific source

What it means

Tool filter lists (availableTools / excludedTools) do not accept a bare "*" wildcard, because that would be ambiguous about which tool source it applies to. validateToolFilterList rejects it and points to the ToolSet builder API (AddBuiltIn/AddMCP/AddCustom) for source-qualified wildcards.

Solutions

  1. Replace the bare "*" with a NewToolSet() builder expression such as AddBuiltIn("*") to include/exclude all built-in tools.
  2. Add source-qualified entries for each source you intend: .AddMCP("*"), .AddCustom("*") as needed.
  3. Review the ToolSet documentation to express 'all tools' with explicit source coverage.

Example fix

// before
config.AvailableTools = []string{"*"}
// after
config.AvailableTools = NewToolSet().AddBuiltIn("*").AddMCP("*").AddCustom("*").List()
Defensive patterns

Strategy: validation

Validate before calling

func validateToolFilters(list []string) error {
    for _, e := range list {
        if e == "*" {
            return fmt.Errorf("bare %q not allowed; use NewToolSet().AddBuiltIn(\"*\") etc.", e)
        }
    }
    return nil
}

Try / catch

if err := client.CreateSession(ctx, cfg); err != nil {
    if strings.Contains(err.Error(), "there is no bare wildcard") {
        // fix config to use source-qualified wildcards
    }
}

Prevention

When it happens

Trigger: Passing ["*"] (or a list containing "*") as availableTools or excludedTools in SessionConfig/ResumeSessionConfig, or through any API that funnels into resolveToolFilterOptions.

Common situations: Users porting config from versions or other SDKs where "*" meant 'all tools'; copy-pasted config examples that predate the source-qualified wildcard requirement.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of github/copilot-sdk@cd8cf15dc3 (2026-09-09). Data as JSON: /api/errors/a7d5c79a8e4a30db. Report an issue: GitHub.

Appendix: source

Thrown at go/mode_empty.go:46

	}
	if opts.SessionFS != nil {
		return
	}
	if _, ok := opts.Connection.(URIConnection); ok {
		return
	}
	panic("Client is in Mode=ModeEmpty but neither BaseDirectory, SessionFS, nor a URIConnection was supplied. " +
		"Empty mode requires explicit, per-tenant storage; set ClientOptions.BaseDirectory or .SessionFS, " +
		"or connect to an externally-managed runtime via URIConnection.")
}

// validateToolFilterList rejects bare "*" entries with an actionable error
// pointing at the [ToolSet] builder. Called for both availableTools and
// excludedTools.
func validateToolFilterList(field string, list []string) error {
	for _, entry := range list {
		if entry == "*" {
			return fmt.Errorf(
				"invalid %s entry %q: there is no bare wildcard. "+
					"Use one or more of NewToolSet().AddBuiltIn(\"*\"), .AddMCP(\"*\"), or .AddCustom(\"*\") "+
					"to target a specific source",
				field, entry)
		}
	}
	return nil
}

// resolveToolFilterOptions validates the configured tool filters and applies
// empty-mode invariants. Returns the (possibly-mutated) request fields to set.
func (c *Client) resolveToolFilterOptions(availableTools, excludedTools []string) (
	[]string, []string, *rpc.OptionsUpdateToolFilterPrecedence, error,
) {
	if err := validateToolFilterList("availableTools", availableTools); err != nil {
		return nil, nil, nil, err
	}
	if err := validateToolFilterList("excludedTools", excludedTools); err != nil {

View on GitHub (pinned to cd8cf15dc3)