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

Function formatAmbiguousResult

backend/api/mcp/tool_resolve.go:325–341  ·  view source on GitHub ↗

formatAmbiguousResult returns an MCP result for ambiguous database matches.

(database string, candidates []Candidate)

Source from the content-addressed store, hash-verified

323
324// formatAmbiguousResult returns an MCP result for ambiguous database matches.
325func formatAmbiguousResult(database string, candidates []Candidate) *mcp.CallToolResult {
326 result := struct {
327 Code string `json:"code"`
328 Message string `json:"message"`
329 Candidates []Candidate `json:"candidates"`
330 }{
331 Code: "AMBIGUOUS_TARGET",
332 Message: fmt.Sprintf("Multiple databases match %q. Specify instance or project to narrow.", database),
333 Candidates: candidates,
334 }
335
336 jsonBytes, _ := json.MarshalIndent(result, "", " ")
337 return &mcp.CallToolResult{
338 Content: []mcp.Content{&mcp.TextContent{Text: string(jsonBytes)}},
339 IsError: true,
340 }
341}

Callers 4

handleQueryDatabaseMethod · 0.85
resolveChangeTargetMethod · 0.85
resolveSchemaTargetMethod · 0.85

Calls

no outgoing calls

Tested by 1