MCPcopy Create free account
hub / github.com/diillson/chatcli / graphViewToolDefinition

Function graphViewToolDefinition

cli/chat_graphview.go:43–95  ·  view source on GitHub ↗

graphViewToolDefinition is the native tool-use definition offered in the chat decision turn. The parameters mirror the @graphview flat-JSON envelope, so the call arguments feed the plugin executor unchanged.

()

Source from the content-addressed store, hash-verified

41// decision turn. The parameters mirror the @graphview flat-JSON envelope, so the
42// call arguments feed the plugin executor unchanged.
43func graphViewToolDefinition() models.ToolDefinition {
44 return models.ToolDefinition{
45 Type: "function",
46 Function: models.ToolFunctionDef{
47 Name: "graphview",
48 Description: "Render an interactive, draggable force-directed graph (Obsidian-style) to a self-contained HTML " +
49 "file and open it in the browser. Use it when the user asks to visualize how concepts/entities/topics " +
50 "relate — especially to map out this conversation. For the conversation, extract the entities and " +
51 "relations yourself and pass them as nodes/edges with source=json.",
52 Parameters: map[string]interface{}{
53 "type": "object",
54 "properties": map[string]interface{}{
55 "source": map[string]interface{}{
56 "type": "string",
57 "enum": []string{"json", "knowledge", "conversation"},
58 "description": "json (default): you supply nodes/edges. knowledge: the in-core knowledge graph. conversation: a structural session graph.",
59 },
60 "title": map[string]interface{}{"type": "string", "description": "Graph title shown in the toolbar."},
61 "theme": map[string]interface{}{"type": "string", "enum": []string{"dark", "light"}},
62 "nodes": map[string]interface{}{
63 "type": "array",
64 "description": "source=json: nodes as {id, label, kind?, summary?, weight?}. kind drives node color.",
65 "items": map[string]interface{}{
66 "type": "object",
67 "properties": map[string]interface{}{
68 "id": map[string]interface{}{"type": "string"},
69 "label": map[string]interface{}{"type": "string"},
70 "kind": map[string]interface{}{"type": "string"},
71 "summary": map[string]interface{}{"type": "string"},
72 "weight": map[string]interface{}{"type": "number"},
73 },
74 "required": []string{"id", "label"},
75 },
76 },
77 "edges": map[string]interface{}{
78 "type": "array",
79 "description": "source=json: edges as {source, target, weight?} between node ids.",
80 "items": map[string]interface{}{
81 "type": "object",
82 "properties": map[string]interface{}{
83 "source": map[string]interface{}{"type": "string"},
84 "target": map[string]interface{}{"type": "string"},
85 "weight": map[string]interface{}{"type": "number"},
86 },
87 "required": []string{"source", "target"},
88 },
89 },
90 },
91 "required": []string{},
92 },
93 },
94 }
95}
96
97// isGraphViewToolName matches the tool name in plugin (@graphview) or native
98// (graphview) form, case-insensitively.

Callers 2

buildChatExceptionToolsFunction · 0.85

Calls

no outgoing calls

Tested by 1