Skip to main content
Glama

memory_ontology

Inspect and extend the memory and entity ontology; manage types, relationships, inference patterns, retention, tag namespaces, and entity aliases to organize memory and resolve entities consistently.

Instructions

Inspect and extend the memory & entity ontology (types, relationships, inference patterns, retention, tag namespaces, entity aliases).

ACTIONS:

  • get: Return the active merged ontology (read-only). Optional: section ('all', 'memory_types', 'relationships', 'type_patterns', 'retention', 'tag_namespaces', 'entity_aliases')

  • resolve_alias: Resolve an entity name/alias to its canonical form and known surface forms (read-only). Params: name

  • add_type / remove_type: Add or remove custom memory types in the DB overlay (write). Params: name, parent (optional)

  • add_relationship / remove_relationship: Add or remove custom relationship types (write). Params: name, valid_patterns, description, symmetric

  • set_type_pattern / clear_type_pattern: Set or clear inference patterns (write). Params: source, target, relationship, confidence

  • set_retention / clear_retention: Set or clear retention days for a memory type (write). Params: memory_type, days

  • add_alias / remove_alias: Map an entity synonym/alias to a canonical entity name (write). Params: alias, canonical

Examples: {"action": "get", "section": "memory_types"} {"action": "resolve_alias", "name": "pg"} {"action": "add_alias", "alias": "pg", "canonical": "PostgreSQL"} {"action": "add_type", "name": "runbook", "parent": "pattern"}

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": {
      "action": "<action>"
    },
    "name": "memory_ontology"
  }
}

Input Schema

NameRequiredDescriptionDefault
daysNoFor 'set_retention': retention period in days (1..3650)
nameNoType, relationship, or entity name
aliasNoFor 'add_alias'/'remove_alias': alias/synonym name
actionYesOntology operation to performget
parentNoFor 'add_type': parent base type (omit for a new base type)
sourceNoFor 'set_type_pattern'/'clear_type_pattern': source base type
targetNoFor 'set_type_pattern'/'clear_type_pattern': target base type
sectionNoFor 'get': slice of the ontology to returnall
canonicalNoFor 'add_alias': canonical entity name
symmetricNoFor 'add_relationship': whether relationship is bidirectional
confidenceNoFor 'set_type_pattern': confidence in (0, 1]
descriptionNoFor 'add_relationship': relationship description
memory_typeNoFor 'set_retention'/'clear_retention': target memory type
relationshipNoFor 'set_type_pattern': relationship name
valid_patternsNoFor 'add_relationship': list of 'source → target' patterns (or '->')

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv13.2.0

TDQS

A4.2/5.0
Behavior4/5

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

The single annotation readOnlyHint=false is coarse for a mixed tool, and the description usefully corrects this by marking 'get' and 'resolve_alias' as read-only and the mutation actions as write, plus noting writes land in a 'DB overlay' rather than the base ontology. It stops short of saying whether remove_type/remove_alias/clear_* are reversible or what happens to existing memories bound to a removed type.

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?

Purpose is front-loaded in one sentence, followed by a scannable action list with inline param notes and four concrete JSON examples. Nothing is redundant; each line carries either an action-to-param mapping or a read/write marker.

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?

With 15 parameters collapsed into one object and no output schema, the description does the necessary work of explaining how parameters group by action. The remaining gap is return shape: 'get' says it returns the merged ontology but not its structure, and no error or unknown-action behavior is described.

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

Parameters3/5

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

Schema coverage is 100%, so the schema already documents all 15 fields, establishing a baseline of 3. The description adds genuine mapping value by pairing each action with its relevant params (e.g. 'add_relationship/remove_relationship: name, valid_patterns, description, symmetric'), which disambiguates a flat union schema, but it adds no constraints or formats beyond the schema's own text.

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 opening sentence gives a specific verb pair and resource: 'Inspect and extend the memory & entity ontology (types, relationships, inference patterns, retention, tag namespaces, entity aliases)'. The scope is unmistakably ontology administration rather than memory content operations like memory_store or memory_search, so an agent can place it without opening the schema.

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?

The ACTIONS block effectively routes usage: 'get' and 'resolve_alias' are explicitly labelled read-only, while add_*/remove_*/set_*/clear_* are labelled write, giving clear when-to-use context per operation. What's missing is explicit exclusion guidance — nothing states when to prefer this over memory_update or memory_resolve for alias work, or when a write action would be ill-advised.

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