mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-06-27 22:36:00 +00:00
✨ Support Model Context Protocol (MCP) https://github.com/siyuan-note/siyuan/issues/13795
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
@@ -44,7 +44,7 @@ var refBacklinksCmd = &cobra.Command{
|
||||
keyword, _ := cmd.Flags().GetString("keyword")
|
||||
sortMode, _ := cmd.Flags().GetInt("sort")
|
||||
|
||||
_, backlinks, _, count, _ := model.GetBacklink2(id, keyword, "", sortMode, 0, false)
|
||||
_, backlinks, _, count, _ := model.GetBacklink2(id, keyword, "", sortMode, 0, model.Conf.Editor.BacklinkContainChildren)
|
||||
|
||||
switch outputFormat {
|
||||
case "json":
|
||||
@@ -71,7 +71,7 @@ var refMentionsCmd = &cobra.Command{
|
||||
keyword, _ := cmd.Flags().GetString("keyword")
|
||||
sortMode, _ := cmd.Flags().GetInt("sort")
|
||||
|
||||
_, _, backmentions, _, count := model.GetBacklink2(id, "", keyword, 0, sortMode, false)
|
||||
_, _, backmentions, _, count := model.GetBacklink2(id, "", keyword, 0, sortMode, model.Conf.Editor.BacklinkContainChildren)
|
||||
|
||||
switch outputFormat {
|
||||
case "json":
|
||||
|
||||
@@ -62,7 +62,7 @@ func refBacklinks(args map[string]interface{}) (CallToolResult, error) {
|
||||
id, _ := args["id"].(string)
|
||||
keyword, _ := args["keyword"].(string)
|
||||
|
||||
_, backlinks, _, _, _ := model.GetBacklink2(id, keyword, "", 0, 0, false)
|
||||
_, backlinks, _, _, _ := model.GetBacklink2(id, keyword, "", 0, 0, model.Conf.Editor.BacklinkContainChildren)
|
||||
if len(backlinks) == 0 {
|
||||
return CallToolResult{Content: []ContentItem{{Type: "text", Text: "no backlinks found"}}}, nil
|
||||
}
|
||||
@@ -79,7 +79,7 @@ func refMentions(args map[string]interface{}) (CallToolResult, error) {
|
||||
id, _ := args["id"].(string)
|
||||
keyword, _ := args["keyword"].(string)
|
||||
|
||||
_, _, mentions, _, _ := model.GetBacklink2(id, "", keyword, 0, 0, false)
|
||||
_, _, mentions, _, _ := model.GetBacklink2(id, "", keyword, 0, 0, model.Conf.Editor.BacklinkContainChildren)
|
||||
if len(mentions) == 0 {
|
||||
return CallToolResult{Content: []ContentItem{{Type: "text", Text: "no mentions found"}}}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user