Skip to main content
Glama
Auto Ontology MCP

Auto Ontology MCP

Insert or upsert knowledge records

add_records
Idempotent

Insert or upsert structured fact records into an existing knowledge entity with source provenance and evidence. Validates batches atomically, normalizes values, and returns inserted, updated, and skipped ids.

Instructions

Insert or upsert structured records into an existing knowledge entity with source provenance, locators, and supporting quotes. Use after define_entity for countable facts; use edit_records to update or delete existing rows by id, save_concept for prose explanations, and save_passages for searchable document excerpts. Validates the entire batch atomically (normalizing currency/dates and resolving refs) so any invalid record aborts the write and returns all errors. Returns inserted, updated, and skipped ids.

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": {
      "entity": "<entity>",
      "records": "<records>"
    },
    "name": "add_records"
  }
}

Input Schema

NameRequiredDescriptionDefault
entityYesExisting knowledge entity (Term) name, e.g. 'Receipt'.
sourceNoWhere this came from: an existing source id, or a new source to register (deduplicated by uri or title).
recordsYesList of record objects mapping column names to values. Strings like '12,000원' or '2026/10/03' are normalized; ref columns accept an id, name (auto-created when create_missing_refs=true), or object. Optional per record: id (update row), _locator, _evidence, _note, _source.
on_conflictNoConflict policy when a record matches an existing row by natural keys or identical values: 'update', 'skip', or 'error'.update
create_missing_refsNoSet true to auto-create referenced entity rows (e.g. a new merchant or author) by name.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.6.2
    • changedInput schema / properties / create_missing_refs / description
      Previous value: -"Create referenced records (a new merchant, author) by name."New value: +"Set true to auto-create referenced entity rows (e.g. a new merchant or author) by name."
    • changedInput schema / properties / entity / description
      Previous value: -"Entity name, e.g. 'Receipt'."New value: +"Existing knowledge entity (Term) name, e.g. 'Receipt'."
    • changedInput schema / properties / on_conflict / description
      Previous value: -"When a record matches an existing one by keys (or is identical)."New value: +"Conflict policy when a record matches an existing row by natural keys or identical values: 'update', 'skip', or 'error'."
    • changedInput schema / properties / records / description
      Previous value: -"Objects of column values. Strings like '12,000원' or '2026/10/03' are normalized. Ref columns accept an id, a name (created when missing) or an object. Optional per record: id (update that row), _locator, _evidence, _note, _source."New value: +"List of record objects mapping column names to values. Strings like '12,000원' or '2026/10/03' are normalized; ref columns accept an id, name (auto-created when create_missing_refs=true), or object. Optional per record: id (update row), _locator, _evidence, _note, _source."
    • changedInput schema / properties / source / anyOf
      Previous value: -[
      -  {
      -    "type": "integer"
      -  },
      -  {
      -    "properties": {
      -      "author": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null
      -      },
      -      "content": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Transcribed text or the relevant excerpt."
      -      },
      -      "id": {
      -        "anyOf": [
      -          {
      -            "type": "integer"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Existing source id; omit to register a new source."
      -      },
      -      "kind": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "pdf, image, web, note, conversation, email, book, ..."
      -      },
      -      "published_on": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "YYYY-MM-DD"
      -      },
      -      "summary": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "What the source is about, in a sentence or two."
      -      },
      -      "title": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "File name, page title or a short label, e.g. 'IMG_2041.jpg'."
      -      },
      -      "uri": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Path or URL of the original, when known."
      -      }
      -    },
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "properties": {
      +      "author": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Author, organization, or speaker who created the source."
      +      },
      +      "content": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "A short excerpt; save longer parts as passages and keep the full text as the original."
      +      },
      +      "id": {
      +        "anyOf": [
      +          {
      +            "type": "integer"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Existing source id; omit to register a new source."
      +      },
      +      "kind": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Source format such as pdf, image, web, note, conversation, email, or book."
      +      },
      +      "original": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Path of the original that is already in the Obsidian vault, relative to the vault, e.g. 'Clippings/Article.md'."
      +      },
      +      "original_file": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Absolute path of a local file (PDF, image, document) to copy into the vault as the original; changed files are copied beside the old one."
      +      },
      +      "original_text": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Full markdown text saved as a new note in the vault's originals folder; passing updated text creates a new note and keeps the old one."
      +      },
      +      "published_on": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Publication or capture date in YYYY-MM-DD format."
      +      },
      +      "summary": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "What the source is about, in a sentence or two."
      +      },
      +      "title": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "File name, page title or a short label, e.g. 'IMG_2041.jpg'."
      +      },
      +      "uri": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Path or URL of the original, when known."
      +      }
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  2. First observedv0.3.0

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations (readOnly=false, idempotent=true, destructive=false), it discloses that validation is batch-atomic, that any invalid record aborts the whole write and returns all errors, and that values are normalized (currency/dates) and refs resolved. That is exactly the failure-mode context an agent needs before a mutation.

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 purpose, then gating guidance, then behavior — a good order with no filler sentences. The closing 'Returns inserted, updated, and skipped ids' is mildly redundant since an output schema exists, but the rest is dense and earns its space.

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 multi-param mutation tool with atomic batch semantics, the definition covers prerequisites (entity must already exist), write behavior, error handling, and alternatives. Return values are covered by the output schema, so nothing essential is missing.

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 already 100%, so baseline is 3; the description goes further by explaining normalization of strings like '12,000원' and '2026/10/03', ref columns accepting id/name/object, source dedup by uri or title, and the per-record special keys (_locator, _evidence, _note, _source). It does not explain on_conflict or create_missing_refs semantics in the prose, leaving those 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?

States a specific verb pair and resource: 'Insert or upsert structured records into an existing knowledge entity', plus the payload traits (source provenance, locators, quotes). An agent can distinguish this from edit_records, save_concept, and save_passages without opening any 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?

Explicitly directs use after define_entity for countable facts and names three alternatives with their distinct purposes (edit_records for update/delete by id, save_concept for prose, save_passages for excerpts). Minor internal tension: the description says to use edit_records for updates, yet the schema and on_conflict default describe upsert/update-by-id behavior here.

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