googleapis/mcp-toolbox · error

field %q: %w

Error message

field %q: %w

What it means

Recursive wrap in convertPlainMap: converting one key of a plain (untyped) map to Firestore format failed; the field name and wrapped error identify the offending entry.

Source

Thrown at internal/tools/firestore/util/converter.go:168

					return convertPlainMap(v, client)
				}
			}
		}
		// Regular map without type annotation
		return convertPlainMap(v, client)
	default:
		// Plain values (for backward compatibility)
		return value, nil
	}
}

// convertPlainMap converts a plain map to Firestore format
func convertPlainMap(m map[string]any, client *firestore.Client) (map[string]any, error) {
	result := make(map[string]any)
	for k, v := range m {
		converted, err := JSONToFirestoreValue(v, client)
		if err != nil {
			return nil, fmt.Errorf("field %q: %w", k, err)
		}
		result[k] = converted
	}
	return result, nil
}

// isValidDocumentPath checks if a string is a valid Firestore document path
// Valid paths have an even number of segments (collection/doc/collection/doc...)
func isValidDocumentPath(path string) bool {
	if path == "" {
		return false
	}

	// Split the path by '/' and check if it has an even number of segments
	segments := splitPath(path)
	return len(segments) > 0 && len(segments)%2 == 0
}

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Fix the named field according to the wrapped error
  2. Ensure nested values use valid types or explicit Firestore value tags
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at internal/tools/firestore/util/converter.go:168 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/9b14503d924c589b. Report an issue: GitHub.