graphlife Docs graphlife.app

MCP tools

2. Concepts used throughout

2.1 Graphs, nodes, edges#

Term Meaning
Graph One knowledge base, identified by a graph id. A credential reaches one or more graphs.
Node A thing: a person, organisation, place, event, concept or document. It has an id, a kind, a label and a props map of attributes.
Edge A typed relationship between two nodes, optionally with validFrom / validTo dates.
Group A named set of nodes. Groups decide who can read what: a scoped credential reads a node only where its groups and the node's groups overlap.
Capture Text stored verbatim as a source, without being turned into nodes.

Node kinds are individual, place, event, concept, document and other. When writing with add_to_graph, an entity may also be declared with a finer word, which is stored as the node's subtype: person, pet, object, asset, org, place, event, job, education, project, health, symbol, document.

Dates are strings in the form YYYY, YYYY-MM or YYYY-MM-DD.

2.2 Scope: what a credential may do#

Every live key and OAuth token carries a scope. The scope is read again on every call, so a change takes effect on the next request.

Scope field Type Default Meaning
tools array of strings the read tools Tool names this credential may call (see below).
groups array of group ids empty Groups whose nodes the credential may read.
allNodes boolean false Read every node in the graph instead of intersecting with groups.
level "full" or "listed" "full" listed returns existence only: kind, a label with identifiers masked, and a document's type.
kinds array of strings empty Allowed node subtypes (used by older keys that predate groups).
nodeIds array of node ids empty An explicit allowlist. When present, only these nodes are readable, and the credential cannot create nodes.
redactProps array of strings empty Attribute names removed from every node returned.
maxNodes integer 200 Hard cap on rows returned by one call. Every limit argument is clamped to it.
writeGroup group id none Where nodes created by this credential are filed. It must be one of groups; otherwise it is ignored.

A scope with no groups, no kinds, no nodeIds and allNodes false reads no nodes at all. (On an organisation graph the rule differs: a key whose groups list is empty reaches the groups of the member who created it.)

Always send groups (an empty array is fine) or level in a scope. A scope object that contains neither key is treated as a key from an older release: it never reads nodes whose subtype is health, capture, page or document, even with allNodes true.

Who may create nodes: a credential creates nodes only when it has allNodes true, or holds exactly one group, or has a valid writeGroup. A credential that holds several groups and no writeGroup, or one restricted by nodeIds, is refused with kind_out_of_scope when it tries to create.

Scope tool names fall into five sets:

Set Tool names
Read stats, search, node, neighbors, subgraph, paths, search_prose
Write add_to_graph, add_capture, update_node, set_groups, create_group, delete_node, delete_edge
Account create_graph
Listing list_nodes, list_edges
Integration changes, export, extract, webhooks, rotate_key (these name HTTP routes, not tools; see the integration API chapter)

The listing and integration names are in no default: a key holds them only when they are named at creation or added later by editing the key.

Several tools have no scope name of their own. They are governed by a name from the table above, so that keys issued before those tools existed keep working:

Tool Requires the scope to hold
context search and subgraph
ask (HTTP only) search and subgraph
get_document, get_nodes node
list_graphs, list_groups stats
add_document, add_edge add_to_graph
end_edge, restore_edge delete_edge
restore_node delete_node
update_group create_group

A scope is stored with its tool list at the time the key is created. A tool name added to the product later is therefore absent from existing keys until they are re-issued. The listing and integration names can be added to an existing key without re-issuing it (see Editing a key).

2.3 Visibility rules that affect every result#

  • A node the credential cannot see is omitted. "Not visible" and "does not exist" are deliberately indistinguishable, and both are reported as not found.
  • A node returned with "withheld": true exists but may not be read in full. Its label has identifiers masked and its attributes are removed.
  • An edge is returned only when both of its ends are visible.
  • A path is returned only when every node on it is visible.
  • A write to a node requires that the credential can already read that node in full.