Skip to main content
Glama
kuzudb

Kuzu MCP server

Official
by kuzudb

getSchema

Retrieve the database schema of Kuzu, enabling natural language interactions and efficient management of graph data structures within the Kuzu MCP server environment.

Instructions

Get the schema of the Kuzu database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'getSchema' tool. It queries the Kuzu database using `show_tables()`, `TABLE_INFO()`, and `SHOW_CONNECTION()` to extract node tables (with properties including primary keys) and relationship tables (with properties and connectivity to source/destination tables), sorts them, and returns the schema object.
    const getSchema = async (connection) => {
      const result = await connection.query("CALL show_tables() RETURN *;");
      const tables = await result.getAll();
      result.close();
      const nodeTables = [];
      const relTables = [];
      for (const table of tables) {
        const properties = (
          await connection
            .query(`CALL TABLE_INFO('${table.name}') RETURN *;`)
            .then((res) => res.getAll())
        ).map((property) => ({
          name: property.name,
          type: property.type,
          isPrimaryKey: property["primary key"],
        }));
        if (table.type === TABLE_TYPES.NODE) {
          delete table["type"];
          delete table["database name"];
          table.properties = properties;
          nodeTables.push(table);
        } else if (table.type === TABLE_TYPES.REL) {
          delete table["type"];
          delete table["database name"];
          properties.forEach((property) => {
            delete property.isPrimaryKey;
          });
          table.properties = properties;
          const connectivity = await connection
            .query(`CALL SHOW_CONNECTION('${table.name}') RETURN *;`)
            .then((res) => res.getAll());
          table.connectivity = [];
          connectivity.forEach(c => {
            table.connectivity.push({
              src: c["source table name"],
              dst: c["destination table name"],
            });
          });
          relTables.push(table);
        }
      }
      nodeTables.sort((a, b) => a.name.localeCompare(b.name));
      relTables.sort((a, b) => a.name.localeCompare(b.name));
      return { nodeTables, relTables };
    };
  • index.js:163-170 (registration)
    Registration of the 'getSchema' tool in the ListToolsRequestSchema handler, specifying name, description, and input schema.
    {
      name: "getSchema",
      description: "Get the schema of the Kuzu database",
      inputSchema: {
        type: "object",
        properties: {},
      },
    }
  • The input schema definition for the 'getSchema' tool: an empty object with no required properties.
    inputSchema: {
      type: "object",
      properties: {},
    },
  • Invocation of the getSchema handler within the general CallToolRequestSchema handler, serializing the schema to JSON text response.
    } else if (request.params.name === "getSchema") {
      const schema = await getSchema(conn);
      return {
        content: [{ type: "text", text: JSON.stringify(schema, null, 2) }],
        isError: false,
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't describe how it behaves—e.g., whether it returns a full schema, requires permissions, has side effects, or handles errors. This leaves significant gaps for a tool that interacts with a database.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence with no wasted words, clearly front-loading the core purpose. It's appropriately sized for a simple tool with no parameters, making it highly efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (simple, no parameters) and lack of annotations and output schema, the description is minimally adequate but incomplete. It states what the tool does but doesn't cover behavioral aspects like return format or error handling, which are important for a database tool, leaving room for improvement.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and the input schema has 100% description coverage (though empty). The description doesn't need to compensate for missing parameter info, so it meets the baseline of 4 for tools with no parameters, as it doesn't mislead about inputs.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and the resource ('schema of the Kuzu database'), making the purpose understandable. However, it doesn't differentiate from its sibling tool 'query' (which likely executes queries rather than retrieving metadata), so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like the 'query' sibling tool. It lacks context about scenarios where retrieving the schema is appropriate, such as for database exploration or query planning, leaving usage entirely implicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kuzudb/kuzu-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server