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

Function selectDataSource

backend/api/mcp/tool_resolve.go:311–322  ·  view source on GitHub ↗

selectDataSource picks READ_ONLY if available, otherwise ADMIN.

(dataSources []dataSource)

Source from the content-addressed store, hash-verified

309
310// selectDataSource picks READ_ONLY if available, otherwise ADMIN.
311func selectDataSource(dataSources []dataSource) string {
312 var adminID string
313 for _, ds := range dataSources {
314 if ds.Type == "READ_ONLY" {
315 return ds.ID
316 }
317 if ds.Type == "ADMIN" {
318 adminID = ds.ID
319 }
320 }
321 return adminID
322}
323
324// formatAmbiguousResult returns an MCP result for ambiguous database matches.
325func formatAmbiguousResult(database string, candidates []Candidate) *mcp.CallToolResult {

Callers 2

matchDatabasesFunction · 0.85
buildAmbiguousResultFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected