Repository: googleapis/genai-toolbox (Go)

Issue:
Support Looker descriptions for dimensions and measures
### Prerequisites

- [x] Search the [current open issues](https://github.com/googleapis/genai-toolbox/issues)

### What are you trying to do that currently feels hard or impossible?

The looker tool `get_dimensions` and `get_measures` does not retrieve available descriptions.

```json
{
  "label":"...",
  "label_short":"...",
  "name":"...",
  "type":"..."
}
```
Dimension and measure descriptions can provide important context about how to query and filter explores.
This is what I want:

```json
{
  "description":"..."
  "label":"...",
  "label_short":"...",
  "name":"...",
  "type":"..."
}
```
This is available using the looker sdk

### Suggested Solution(s)

add `description` to  the field definitions in lookercommon.go

```go
const (
	DimensionsFields = "fields(dimensions(name,type,label,label_short,description))"
	FiltersFields    = "fields(filters(name,type,label,label_short))"
	MeasuresFields   = "fields(measures(name,type,label,label_short,description))"
	ParametersFields = "fields(parameters(name,type,label,label_short))"
)
```

Update the ExtractLookerFieldProperties to handle descriptions
```go
func ExtractLookerFieldProperties(ctx context.Context, fields *[]v4.LookmlModelExploreField) ([]any, error) {
	data := make([]any, 0)

	// Handle nil fields pointer
	if fields == nil {
		return data, nil
	}

	logger, err := util.LoggerFromContext(ctx)
	if err != nil {
		// This should ideally not happen if the context is properly set up.
		// Log and return an empty map or handle as appropriate for your error strategy.
		return data, fmt.Errorf("error getting logger from context in ExtractLookerFieldProperties: %v", err)
	}

	for _, v := range *fields {
		logger.DebugContext(ctx, "Got response element of %v\n", v)
		vMap := make(map[string]any)
		if v.Name != nil {
			vMap["name"] = *v.Name
		}
		if v.Type != nil {
			vMap["type"] = *v.Type
		}
		if v.Label != nil {
			vMap["label"] = *v.Label
		}
		if v.LabelShort != nil {
			vMap["label_short"] = *v.LabelShort
		}
		if v.Description != nil {
			vMap["description"] = *v.Description
		}
		logger.DebugContext(ctx, "Converted to %v\n", vMap)
		data = append(data, vMap)
	}

	return data, nil
}
```

and add relevant tests


### Alternatives Considered

_No response_

### Additional Details

_No response_



Fix (patch):
diff --git a/internal/tools/looker/lookercommon/lookercommon.go b/internal/tools/looker/lookercommon/lookercommon.go
index 4fbadb54526..3ba8bb21990 100644
--- a/internal/tools/looker/lookercommon/lookercommon.go
+++ b/internal/tools/looker/lookercommon/lookercommon.go
@@ -24,15 +24,20 @@ import (
 )
 
 const (
-	DimensionsFields = "fields(dimensions(name,type,label,label_short))"
-	FiltersFields    = "fields(filters(name,type,label,label_short))"
-	MeasuresFields   = "fields(measures(name,type,label,label_short))"
-	ParametersFields = "fields(parameters(name,type,label,label_short))"
+	DimensionsFields = "fields(dimensions(name,type,label,label_short,description))"
+	FiltersFields    = "fields(filters(name,type,label,label_short,description))"
+	MeasuresFields   = "fields(measures(name,type,label,label_short,description))"
+	ParametersFields = "fields(parameters(name,type,label,label_short,description))"
 )
 
 // ExtractLookerFieldProperties extracts common properties from Looker field objects.
 func ExtractLookerFieldProperties(ctx context.Context, fields *[]v4.LookmlModelExploreField) ([]any, error) {
-	var data []any
+	data := make([]any, 0)
+
+	// Handle nil fields pointer
+	if fields == nil {
+		return data, nil
+	}
 
 	logger, err := util.LoggerFromContext(ctx)
 	if err != nil {
@@ -56,6 +61,9 @@ func ExtractLookerFieldProperties(ctx context.Context, fields *[]v4.LookmlModelE
 		if v.LabelShort != nil {
 			vMap["label_short"] = *v.LabelShort
 		}
+		if v.Description != nil {
+			vMap["description"] = *v.Description
+		}
 		logger.DebugContext(ctx, "Converted to %v\n", vMap)
 		data = append(data, vMap)
 	}