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

Method Schema

cli/plugins/builtin_graphview.go:169–192  ·  view source on GitHub ↗

Schema describes the tool for the LLM catalog.

()

Source from the content-addressed store, hash-verified

167
168// Schema describes the tool for the LLM catalog.
169func (*BuiltinGraphViewPlugin) Schema() string {
170 schema := map[string]interface{}{
171 "argsFormat": "flat JSON preferred",
172 "description": "Render an interactive, draggable force-directed graph (Obsidian-style) to a self-contained HTML file and open it in the browser. " +
173 "Use it to visualize how concepts, entities, files or topics relate — especially to map out the current conversation/session.",
174 "flags": []map[string]interface{}{
175 {"name": "source", "type": "string", "description": "json (default): you provide nodes/edges. knowledge: the in-core knowledge graph. conversation: a structural graph of this session."},
176 {"name": "nodes", "type": "array", "description": "source=json. Array of {id, label, kind?, summary?, weight?}. kind drives node color (e.g. topic, project, file, entity, person)."},
177 {"name": "edges", "type": "array", "description": "source=json. Array of {source, target, weight?} where source/target are node ids."},
178 {"name": "file", "type": "string", "description": "Path to a JSON file holding {\"nodes\":[...],\"edges\":[...]} — use for large graphs instead of inline args."},
179 {"name": "title", "type": "string", "description": "Graph title shown in the toolbar."},
180 {"name": "theme", "type": "string", "description": "dark (default) or light."},
181 {"name": "output", "type": "string", "description": "Path to write the .html file (default: a temp file)."},
182 {"name": "open", "type": "boolean", "description": "Open the result in the default browser (default true)."},
183 },
184 "examples": []string{
185 `{"title":"What we discussed","nodes":[{"id":"oauth","label":"OAuth login","kind":"topic"},{"id":"token","label":"Token exchange","kind":"topic"},{"id":"cli","label":"ChatCLI","kind":"project"}],"edges":[{"source":"cli","target":"oauth"},{"source":"oauth","target":"token","weight":2}]}`,
186 `{"source":"knowledge"}`,
187 `{"source":"conversation"}`,
188 },
189 }
190 data, _ := json.Marshal(schema)
191 return string(data)
192}
193
194// Execute parses args and renders the graph.
195func (p *BuiltinGraphViewPlugin) Execute(ctx context.Context, args []string) (string, error) {

Callers 1

Calls

no outgoing calls

Tested by 1