Skip to main content
Glama

kernel_graph_slice

Extract a read-only slice of the main graph via Cypher, returning nodes, relationships or paths into a scratch graph or JSON for sandboxed agents and files.

Instructions

Take a slice of Kernl's main graph with a READ-ONLY query that returns nodes, relationships or paths (e.g. MATCH p = (:Person {name: $n})-[*1..2]-() RETURN p), checked like kernel_graph_query. into: "scratch" (default) copies it into your scratch graph, keeping labels and properties, with _src set to the original's element id; into: "json" returns it as nodes and relationships, for a sandboxed agent or a file. Embeddings are left out.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "cypher": "<cypher>"
    },
    "name": "kernel_graph_slice"
  }
}

Input Schema

NameRequiredDescriptionDefault
intoNoscratch
rowsNoMost rows the query may return.
cypherYes
paramsNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.1

TDQS

A4.1/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden, and it does disclose meaningful behavior: READ-ONLY enforcement, that the query is validated like kernel_graph_query, that labels and properties are preserved with `_src` set to the source element id, and that embeddings are omitted. It stays silent on what happens when the slice exceeds the `rows` cap and on any permission requirements.

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

Conciseness4/5

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

Single dense paragraph, front-loaded with the core action and example before the mode-specific details. The backtick-heavy prose is information-dense with little waste, though the `into` explanation could be split for faster scanning.

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

Completeness4/5

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

An output schema exists, so return values need not be described, yet the description helpfully explains the json shape anyway. For a 4-parameter cypher tool this is nearly complete; only row-limit behavior and failure modes are absent.

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?

Schema coverage is only 25% (only `rows` is documented in-schema), so the description must compensate, and it does for `into`: both enum values, the default, and the resulting graph shape and `_src` marker are spelled out. The example's `$n` implies the `params` binding, but `rows` truncation semantics are left unexplained in both places.

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

Purpose5/5

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

States a specific verb and resource ('Take a slice of Kernl's main graph') and pins down the two output modes, with an inline cypher example showing the shape of a valid query. It also distinguishes itself from the sibling read tool by positioning itself as the extraction/copy path ('checked like kernel_graph_query') rather than the query tool itself.

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

Usage Guidelines4/5

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

Gives concrete conditions for each mode: scratch is the default for materializing a subgraph locally, json is for 'a sandboxed agent or a file'. It also signals the query is READ-ONLY and subject to the same checking as kernel_graph_query. It does not explicitly state when to prefer this over kernel_graph_query itself, which keeps it from a 5.

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

Deploy Server

Other Tools