Skip to main content
Glama

knowmind_upsert_entity

Idempotent

Create or retrieve a graph entity for a named person, organization, application, host, or technology so memories mentioning the same thing connect instead of staying separate.

Instructions

Create the node for a thing the corpus talks about - a person, an organisation, an application, a host, a technology - or return the existing one. THE GRAPH NEEDS THESE: memories are texts, and two texts mentioning the same server stay unconnected until that server exists as its own node. Create an entity when a name recurs across memories or when you are about to link something that has no node yet, then connect it with knowmind_link. Same name, same class and same tenant always return the same id, so calling twice creates no duplicate. Give the entity its plain proper name ("PostgreSQL", not "the database we use"), and pick the class from the catalogue in knowmind_schema. Requires write scope.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesProper name of the thing, as it would be written in a document. No role, no status, no description.
aliasesNoOther spellings the same thing appears under. Optional.
descriptionNoOne sentence saying what this is. Optional, helps later retrieval.
entity_classYesClass from the catalogue (knowmind_schema -> entityClasses), e.g. Person, Organization, Application, Host, Technology.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.4.5

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare non-read-only plus idempotent, but the description goes further: it names the identity key ('same name, same class and same tenant always return the same id, so calling twice creates no duplicate') and discloses the authorization prerequisite ('Requires write scope'), neither of which appears in the annotation block. It stops short of describing the returned payload beyond 'the existing one', which is a minor residual gap.

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?

Front-loaded with the core action and its dedup behavior, and the routing sentence to knowmind_link comes before the finer naming conventions. The capitalized 'THE GRAPH NEEDS THESE' framing is rhetorical padding that does not add actionable content, but the remainder is dense and earns its place.

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 four-parameter, partially-required write tool with full schema coverage and no output schema, the description covers the essential set: when to call, key identity semantics, authorization scope, naming convention, and where to source the class catalogue. There is no output schema, so return values need not be enumerated.

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, and the description adds meaning beyond it by directing where entity_class values come from ('pick the class from the catalogue in knowmind_schema') and reinforcing the naming convention for name. That cross-tool pointer is genuinely useful, though the naming advice partially duplicates the schema's own wording.

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?

The description states a specific verb and resource ('Create the node for a thing the corpus talks about') and immediately covers the upsert fallback ('or return the existing one'), listing the entity kinds it applies to. It also separates itself from knowmind_link, which is the nearest sibling, so an agent can route correctly without opening either schema.

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

Usage Guidelines5/5

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

It gives explicit triggering conditions ('when a name recurs across memories or when you are about to link something that has no node yet') and names the follow-up tool ('then connect it with knowmind_link'). Alternatives and ordering relative to linking are both stated, not implied.

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