query
Execute Cypher queries on a Kuzu graph database to retrieve, create, or modify data. Integrates with tools like Claude Desktop or Cursor for streamlined database interactions.
Instructions
Run a Cypher query on the Kuzu database
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cypher | No | The Cypher query to run |
Input Schema (JSON Schema)
{
"properties": {
"cypher": {
"description": "The Cypher query to run",
"type": "string"
}
},
"type": "object"
}
Implementation Reference
- index.js:176-190 (handler)Handler for the "query" tool: extracts cypher from arguments, executes it using conn.query, retrieves all rows, serializes with bigint replacer, and returns as text content.if (request.params.name === "query") { const cypher = request.params.arguments.cypher; try { const queryResult = await conn.query(cypher); const rows = await queryResult.getAll(); queryResult.close(); return { content: [{ type: "text", text: JSON.stringify(rows, bigIntReplacer, 2) }], isError: false, }; } catch (error) { throw error; }
- index.js:150-162 (registration)Registration of the "query" tool in the ListTools response, including name, description, and input schema.{ name: "query", description: "Run a Cypher query on the Kuzu database", inputSchema: { type: "object", properties: { cypher: { type: "string", description: "The Cypher query to run", }, }, }, },
- index.js:153-161 (schema)Input schema definition for the "query" tool, specifying the required 'cypher' string parameter.inputSchema: { type: "object", properties: { cypher: { type: "string", description: "The Cypher query to run", }, }, },