Skip to content

Commit 5b1f328

Browse files
authored
mcp: uncomment test, change struct{} to any (#341)
Address comments on #325.
1 parent 32cf71d commit 5b1f328

File tree

3 files changed

+163
-206
lines changed

3 files changed

+163
-206
lines changed

examples/server/memory/kb.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -482,34 +482,34 @@ func (k knowledgeBase) AddObservations(ctx context.Context, req *mcp.ServerReque
482482
}, nil
483483
}
484484

485-
func (k knowledgeBase) DeleteEntities(ctx context.Context, req *mcp.ServerRequest[*mcp.CallToolParams], args DeleteEntitiesArgs) (*mcp.CallToolResult, struct{}, error) {
485+
func (k knowledgeBase) DeleteEntities(ctx context.Context, req *mcp.ServerRequest[*mcp.CallToolParams], args DeleteEntitiesArgs) (*mcp.CallToolResult, any, error) {
486486
var res mcp.CallToolResult
487487

488488
err := k.deleteEntities(args.EntityNames)
489489
if err != nil {
490-
return nil, struct{}{}, err
490+
return nil, nil, err
491491
}
492492

493493
res.Content = []mcp.Content{
494494
&mcp.TextContent{Text: "Entities deleted successfully"},
495495
}
496496

497-
return &res, struct{}{}, nil
497+
return &res, nil, nil
498498
}
499499

500-
func (k knowledgeBase) DeleteObservations(ctx context.Context, req *mcp.ServerRequest[*mcp.CallToolParams], args DeleteObservationsArgs) (*mcp.CallToolResult, struct{}, error) {
500+
func (k knowledgeBase) DeleteObservations(ctx context.Context, req *mcp.ServerRequest[*mcp.CallToolParams], args DeleteObservationsArgs) (*mcp.CallToolResult, any, error) {
501501
var res mcp.CallToolResult
502502

503503
err := k.deleteObservations(args.Deletions)
504504
if err != nil {
505-
return nil, struct{}{}, err
505+
return nil, nil, err
506506
}
507507

508508
res.Content = []mcp.Content{
509509
&mcp.TextContent{Text: "Observations deleted successfully"},
510510
}
511511

512-
return &res, struct{}{}, nil
512+
return &res, nil, nil
513513
}
514514

515515
func (k knowledgeBase) DeleteRelations(ctx context.Context, req *mcp.ServerRequest[*mcp.CallToolParams], args DeleteRelationsArgs) (*mcp.CallToolResult, struct{}, error) {
@@ -554,8 +554,7 @@ func (k knowledgeBase) SearchNodes(ctx context.Context, req *mcp.ServerRequest[*
554554
&mcp.TextContent{Text: "Nodes searched successfully"},
555555
}
556556

557-
res.StructuredContent = graph
558-
return &res, KnowledgeGraph{}, nil
557+
return &res, graph, nil
559558
}
560559

561560
func (k knowledgeBase) OpenNodes(ctx context.Context, req *mcp.ServerRequest[*mcp.CallToolParams], args OpenNodesArgs) (*mcp.CallToolResult, KnowledgeGraph, error) {

0 commit comments

Comments
 (0)