Skip to main content
Glama

Create Records

create_records

Create multiple linked genealogy records in one atomic call, including people, families, events, places, sources, citations, notes, and repositories; all succeed together or none are saved.

Instructions

Create many linked records in one call: repositories, places, sources, notes, citations, events, people and families. Gramps Web saves them in one transaction, so either all are created or none, and undo_change on that transaction (get_recent_changes) removes them all again. Give a record that others link to a key and write "#key" wherever a handle is taken: a citation's sourceHandle "#src", an event's citationHandles ["#cit"], a person's eventRefs ["#birth"], a family's fatherHandle "#ivan" and childRefs ["#petr"]. Existing records are linked by handle, or by Gramps ID where the create tool accepts one. Each record takes the arguments of its create tool (create_person, create_event, …), except that people join families only through families: a new family's father, mother and children get the link back. Links from existing records to new ones, such as a new child of an existing family, are made afterwards with update_* and linkMode "add". Media and tags are not created here: create them first with create_media and create_tag. Each new person is checked for duplicates in the tree as in create_person: a possible duplicate stops the whole call with action "refused", and notDuplicateOf on that person lets it through; other record types are not checked, so search first. Up to 50 records per call; every record is checked before anything is saved, and an error names the record, e.g. people[1]. Returns each record's handle and Gramps ID. Writes run one at a time and need a Gramps Web account allowed to edit the tree; a locked or rate-limited write fails with the delay to wait before retrying it. Formats of every argument: get_reference(topic: "input-guide").

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "create_records"
  }
}

Input Schema

NameRequiredDescriptionDefault
notesNoNew notes; fields as in create_note. Other records link them through noteHandles.
eventsNoNew events; fields as in create_event. People and families link them through eventRefs.
peopleNoNew people; fields as in create_person, without familyHandles and parentFamilyHandles: name a person in a family's fatherHandle, motherHandle or childRefs instead.
placesNoNew places; fields as in create_place. enclosedBy may name a place of this call by "#key".
sourcesNoNew sources; fields as in create_source.
familiesNoNew families; fields as in create_family. They are saved after the people, which get the link back.
citationsNoNew citations; fields as in create_citation. Other records link them through citationHandles.
repositoriesNoNew repositories; fields as in create_repository.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv2.10.0
    • changedInput schema / properties / repositories / items / properties / address / description
      Previous value: -"Postal address as one line."New value: +"Postal address as one line, stored as the street; for a city, postal code or country use addresses."
    • addedInput schema / properties / repositories / items / properties / addresses
      Added value: +{
      +  "description": "Addresses with separate fields, as in create_person; not together with address."
      +}
    • changedInput schema / properties / repositories / items / properties / url / description
      Previous value: -"Website."New value: +"Website, stored as a Web Home link; for other link types or a description use urls."
    • addedInput schema / properties / repositories / items / properties / urls
      Added value: +{
      +  "description": "Links with type and description, as in create_person; not together with url."
      +}
  2. Changed1 schema field changedv2.9.1
    • addedInput schema / properties / people / items / properties / notDuplicateOf
      Added value: +{
      +  "description": "People of the tree who are someone else, from the possible duplicates of a refused call: Gramps IDs or handles, e.g. [\"I0012\"]. The duplicate check passes over them."
      +}
  3. Changed2 schema fields changedv2.8.1
    • changedInput schema / properties / families / items / properties / eventRefs / description
      Previous value: -"Family events such as Marriage: handles or #keys, optionally \"#key::Family\" or {ref, role}."New value: +"Family events such as Marriage: handles or #keys, each optionally with a role as \"#key::Role\" or {ref, role} (default Family)."
    • changedInput schema / properties / families / items / properties / relationshipType / description
      Previous value: -"Married (default), Unmarried, Civil Union or Unknown."New value: +"Married, Unmarried, Civil Union or Unknown (default, as in Gramps). Pass Married when a source records the marriage."
  4. Addedv2.8.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare the write, non-idempotent, non-destructive profile, and the description adds substantial context beyond them: all-or-nothing transaction semantics, reversibility via undo_change on the transaction, a 50-record cap, the duplicate-refusal behavior with action "refused" and the notDuplicateOf escape, error addressing like people[1], edit-permission requirements, and lock/rate-limit failure with a retry delay. This is exactly the behavioral disclosure the annotations cannot carry.

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 and scoping, then linking semantics, then limits, errors, and auth — a sensible ordering. It is a dense single block of prose, and the get_reference pointer at the end is a slightly awkward tail, but almost every sentence carries distinct information for a tool with eight heterogeneous arrays.

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 high-complexity batch mutation with no output schema, the description covers return values (each record's handle and Gramps ID), failure modes, validation timing, permissions, rate limits, and the linking model. An agent could invoke this correctly without opening any sibling create tool.

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 description coverage is 100%, so the baseline is 3; the description earns above that by explaining the cross-record linking model that the per-field descriptions only imply — giving a key to a record others reference, writing "#key" wherever a handle is taken, and the worked examples (sourceHandle "#src", citationHandles ["#cit"], childRefs ["#petr"]). It also states that each record takes its create tool's arguments, which frames all eight top-level arrays at once.

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 ("Create many linked records in one call") and enumerates exactly which record types are covered. The word "many" plus the enumeration immediately distinguishes it from the single-record siblings create_person, create_event, and so on.

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?

Explicitly excludes media and tags and routes them to create_media and create_tag, states that links from existing records to new ones must be made afterwards with update_* and linkMode "add", and tells the agent to search first for record types other than people that aren't duplicate-checked. It also states the people/families exception, so the agent knows not to use familyHandles here.

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