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

Method formatServiceList

backend/api/mcp/tool_search.go:77–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

75}
76
77func (s *Server) formatServiceList() string {
78 services := s.openAPIIndex.Services()
79 var sb strings.Builder
80
81 sb.WriteString("## Available Services\n\n")
82 sb.WriteString("Use `search_api(service=\"ServiceName\")` to list endpoints in a service.\n\n")
83
84 for _, svc := range services {
85 endpoints := s.openAPIIndex.GetServiceEndpoints(svc)
86 fmt.Fprintf(&sb, "- **%s** (%d endpoints)\n", svc, len(endpoints))
87 }
88
89 fmt.Fprintf(&sb, "\nTotal: %d services\n", len(services))
90 return sb.String()
91}
92
93func (*Server) formatEndpoints(endpoints []*EndpointInfo, limit int) string {
94 var sb strings.Builder

Callers 1

handleSearchAPIMethod · 0.95

Calls 3

ServicesMethod · 0.80
GetServiceEndpointsMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected