read_graph takes no args
This commit is contained in:
parent
d9f2cb0b1d
commit
6a50ecadc2
1 changed files with 4 additions and 2 deletions
|
|
@ -376,6 +376,10 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
||||||
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
||||||
const { name, arguments: args } = request.params;
|
const { name, arguments: args } = request.params;
|
||||||
|
|
||||||
|
if (name === "read_graph") {
|
||||||
|
return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.readGraph(), null, 2) }] };
|
||||||
|
}
|
||||||
|
|
||||||
if (!args) {
|
if (!args) {
|
||||||
throw new Error(`No arguments provided for tool: ${name}`);
|
throw new Error(`No arguments provided for tool: ${name}`);
|
||||||
}
|
}
|
||||||
|
|
@ -396,8 +400,6 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
||||||
case "delete_relations":
|
case "delete_relations":
|
||||||
await knowledgeGraphManager.deleteRelations(args.relations as Relation[]);
|
await knowledgeGraphManager.deleteRelations(args.relations as Relation[]);
|
||||||
return { content: [{ type: "text", text: "Relations deleted successfully" }] };
|
return { content: [{ type: "text", text: "Relations deleted successfully" }] };
|
||||||
case "read_graph":
|
|
||||||
return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.readGraph(), null, 2) }] };
|
|
||||||
case "search_nodes":
|
case "search_nodes":
|
||||||
return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.searchNodes(args.query as string), null, 2) }] };
|
return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.searchNodes(args.query as string), null, 2) }] };
|
||||||
case "open_nodes":
|
case "open_nodes":
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue