resolveDatabase resolves a database name to a unique resource using tiered matching.
(ctx context.Context, database, instance, project string)
| 190 | |
| 191 | // resolveDatabase resolves a database name to a unique resource using tiered matching. |
| 192 | func (s *Server) resolveDatabase(ctx context.Context, database, instance, project string) (*resolvedDatabase, error) { |
| 193 | databases, err := s.listDatabases(ctx, buildDatabaseFilter(database, instance, project)) |
| 194 | if err != nil { |
| 195 | return nil, err |
| 196 | } |
| 197 | return matchDatabases(databases, database, instance, project) |
| 198 | } |
| 199 | |
| 200 | // elicitDatabaseChoice prompts the user to pick from ambiguous database matches |
| 201 | // using MCP elicitation. Returns an error if elicitation is unsupported, the user |