googleapis/mcp-toolbox · error

invalid character for resource name; only uppercase and lowe

Error message

invalid character for resource name; only uppercase and lowercase ASCII letters (A-Z, a-z), digits (0-9), underscore (_), hyphen (-), and dot (.) is allowed

What it means

Error "invalid character for resource name; only uppercase and lowercase ASCII letters (A-Z, a-z), digits (0-9), underscore (_), hyphen (-), and dot (.) is allowed" thrown in googleapis/mcp-toolbox.

Source

Thrown at internal/server/config.go:619

	return promptCfg, nil
}

// Tools naming validation is added in the MCP v2025-11-25, but we'll be
// implementing it across Toolbox
// Tool names SHOULD be between 1 and 128 characters in length (inclusive).
// Tool names SHOULD be considered case-sensitive.
// The following SHOULD be the only allowed characters: uppercase and lowercase ASCII letters (A-Z, a-z), digits (0-9), underscore (_), hyphen (-), and dot (.)
// Tool names SHOULD NOT contain spaces, commas, or other special characters.
// Tool names SHOULD be unique within a server.
func NameValidation(name string) error {
	strLen := len(name)
	if strLen < 1 || strLen > 128 {
		return fmt.Errorf("resource name SHOULD be between 1 and 128 characters in length (inclusive)")
	}
	validChars := regexp.MustCompile("^[a-zA-Z0-9_.-]+$")
	isValid := validChars.MatchString(name)
	if !isValid {
		return fmt.Errorf("invalid character for resource name; only uppercase and lowercase ASCII letters (A-Z, a-z), digits (0-9), underscore (_), hyphen (-), and dot (.) is allowed")
	}
	return nil
}

func formatDocLocation(docIndex int, keyToken *token.Token, body ast.Node) string {
	line, column := 0, 0
	if keyToken != nil {
		line = keyToken.Position.Line
		column = keyToken.Position.Column
	} else if body != nil && body.GetToken() != nil {
		line = body.GetToken().Position.Line
		column = body.GetToken().Position.Column
	}
	if line > 0 && column > 0 {
		return fmt.Sprintf("document %d (line %d, column %d):", docIndex, line, column)
	}
	return fmt.Sprintf("document %d:", docIndex)
}

View on GitHub (pinned to 8cc6e09de2)

When it happens

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

Common situations: See trigger scenarios.

Understand the failure class


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