Skip to main content
Glama
grafeo-mcp

grafeo-mcp

Official
by GrafeoDB

execute_gql

Destructive

Run one GQL statement in the graph database to match multi-hop patterns, filter, aggregate, or upsert with MERGE. Use it to read and write nodes and edges in a single call.

Instructions

Run one GQL statement: multi-hop patterns, filters, aggregations, MERGE upserts, label changes.

Cypher syntax (CREATE, MERGE, OPTIONAL MATCH, DETACH DELETE) runs as written. Rules:

  • One statement per call; chain clauses instead (MATCH ... INSERT ...).

  • Put values in params as $name, not in the text. Embeddings too: a list literal is stored as a list, which vector indexes skip.

  • 1.5 is an exact decimal (0.1 + 0.2 = 0.3); 1.5e0 is a float. Overflow and division by zero fail.

  • No WHERE right after INSERT, CREATE, MERGE or DELETE: filter before the write, or WITH ... WHERE after it.

  • A path pattern in WHERE needs EXISTS: WHERE EXISTS { (p)-[:WORKS_AT]->(:Company) }, not WHERE (p)-->(..).

  • DELETE takes variables: MATCH (b)-[w:WORKS_AT]->(c) DELETE w, not DELETE (b)-[:WORKS_AT]->(c).

  • ORDER BY puts nulls last.

Returns {columns, rows, total_rows}; a node in a row is a map with _id, _labels and its properties, an edge has _id, _type, _source, _target. Writes add counters. A read that finds nothing, or only nulls, gets a hint naming the labels, edge types or properties that do not exist.

Example: MERGE (p:Person {name: $name}) SET p += $props RETURN id(p) AS id with params={"name": "Ada", "props": {"born": 1815}}

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": {
      "query": "<query>"
    },
    "name": "execute_gql"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMost rows to return; LIMIT in the query also works.
queryYesOne GQL statement.
paramsNoValues for $name in the query: {"name": "Ada"}.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv0.3.0
    • addedInput schema / properties / limit / description
      Added value: +"Most rows to return; LIMIT in the query also works."
    • removedInput schema / properties / limit / title
      Removed value: -"Limit"
    • addedInput schema / properties / params
      Added value: +{
      +  "description": "Values for $name in the query: {\"name\": \"Ada\"}.",
      +  "type": "object"
      +}
    • addedInput schema / properties / query / description
      Added value: +"One GQL statement."
    • removedInput schema / properties / query / title
      Removed value: -"Query"
    • removedInput schema / title
      Removed value: -"execute_gqlArguments"
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "result": {
      -      "title": "Result",
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "result"
      -  ],
      -  "title": "execute_gqlOutput",
      -  "type": "object"
      -}New value: +null
  2. First observedv0.2.0

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the annotations (destructiveHint=true, readOnly=false, idempotent=false): it discloses the return shape {columns, rows, total_rows}, that writes add counters, that empty reads return hints naming nonexistent labels/types/properties, decimal vs float semantics, and that overflow and division by zero fail outright.

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?

Front-loaded with purpose, then a tight rules list, then return shape, then a worked example. Every bullet is a concrete constraint or gotcha that an agent would otherwise get wrong; nothing is filler.

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

Completeness5/5

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

For a destructive, open-ended query-language tool with no output schema, the description still covers return structure, write side effects, failure modes, and a runnable example. An agent has enough to call this correctly on the first try.

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 100%, so the baseline is 3, but the description adds real meaning: values must go through $name placeholders in params rather than inline text, and embedding lists written as list literals are stored as lists that vector indexes skip. The limit parameter is left entirely to the schema.

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?

Opens with a specific verb and resource ("Run one GQL statement") and immediately enumerates what that covers – multi-hop patterns, filters, aggregations, MERGE upserts, label changes – which distinguishes this general escape hatch from narrow siblings like create_node or search_text.

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 operative guidance on how to use it: one statement per call, chain clauses instead of batching, put values in params, filter before writes rather than WHERE after them. It doesn't explicitly say when to prefer this over single-purpose siblings such as create_edge or vector_search, so it stops short of full routing guidance.

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