MCPcopy Index your code
hub / github.com/apache/answer / NewMCPSearchCond

Function NewMCPSearchCond

internal/schema/mcp_schema.go:145–163  ·  view source on GitHub ↗
(request mcp.CallToolRequest)

Source from the content-addressed store, hash-verified

143}
144
145func NewMCPSearchCond(request mcp.CallToolRequest) *MCPSearchCond {
146 cond := &MCPSearchCond{}
147 if keyword, ok := getRequestValue(request, MCPSearchCondKeyword); ok {
148 cond.Keyword = keyword
149 }
150 if username, ok := getRequestValue(request, MCPSearchCondUsername); ok {
151 cond.Username = username
152 }
153 if score, ok := getRequestNumber(request, MCPSearchCondScore); ok {
154 cond.Score = score
155 }
156 if tag, ok := getRequestValue(request, MCPSearchCondTag); ok {
157 cond.Tags = strings.Split(tag, ",")
158 }
159 if questionID, ok := getRequestValue(request, MCPSearchCondQuestionID); ok {
160 cond.QuestionID = questionID
161 }
162 return cond
163}
164
165func NewMCPSearchAnswerCond(request mcp.CallToolRequest) *MCPSearchCond {
166 cond := &MCPSearchCond{}

Callers 1

MCPQuestionsHandlerMethod · 0.92

Calls 2

getRequestValueFunction · 0.85
getRequestNumberFunction · 0.85

Tested by

no test coverage detected