feat(ingestion): implement brain_query MCP tool
Wraps the existing search.Query function. Same BM25 over brain/knowledge/ and brain/wiki/ that the HTTP /query endpoint serves. Plan note: handleCall switch replaces the single-line stub from Task 1 — no unknownToolError type to remove since Task 1 inlined the error. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -113,7 +113,12 @@ func writeError(w http.ResponseWriter, id any, code int, msg string) {
|
||||
})
|
||||
}
|
||||
|
||||
// handleCall dispatches a tools/call. Stub for Task 1; expanded in later tasks.
|
||||
// handleCall dispatches a tools/call to the appropriate tool handler.
|
||||
func (s *Server) handleCall(ctx context.Context, name string, args json.RawMessage) (json.RawMessage, error) {
|
||||
return nil, fmt.Errorf("unknown tool: %s", name)
|
||||
switch name {
|
||||
case "brain_query":
|
||||
return s.brainQuery(ctx, args)
|
||||
default:
|
||||
return nil, fmt.Errorf("unknown tool: %s", name)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user