MCPcopy Create free account
hub / github.com/bytebase/bytebase / resolveDatabase

Method resolveDatabase

backend/api/mcp/tool_resolve.go:192–198  ·  view source on GitHub ↗

resolveDatabase resolves a database name to a unique resource using tiered matching.

(ctx context.Context, database, instance, project string)

Source from the content-addressed store, hash-verified

190
191// resolveDatabase resolves a database name to a unique resource using tiered matching.
192func (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

Calls 3

listDatabasesMethod · 0.95
matchDatabasesFunction · 0.85
buildDatabaseFilterFunction · 0.70