Skip to main content
Glama

Create Citation

create_citation

Creates a citation for a specific page, act, or entry in an existing source, with date, confidence, notes and media, so you can attach it to people, families, events or places.

Instructions

Create a citation: one specific spot in an existing source, such as a page, act or entry number, with its date, confidence, notes and media. Returns the new handle, Gramps ID and page, with next steps. The source must already exist (search, or create_source). A transcript of the entry goes in a note (create_note, type Transcript) passed in noteHandles; the scan goes in mediaHandles, or later through create_media attachTo, which can mark the entry's region on the page. The citation supports nothing until it is attached: add it to each person, family, event or place it names (citationHandles, linkMode add, on their update tool). Does not check for duplicates; change an existing citation with update_citation. For several new records that link to each other, such as the people, events, source and citation of one register entry, use create_records instead: one transaction, all created or none. 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

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": {
      "sourceHandle": "<sourceHandle>"
    },
    "name": "create_citation"
  }
}

Input Schema

NameRequiredDescriptionDefault
dateNoDate of the cited entry, optional. Date text: 1856-07-20, 1920-05, 1920, 1 Jul 1919, about/before/after 1920, 1800-1850, between … and …; append the calendar for other calendars, e.g. 1856-07-20 (Julian). Unreadable dates are rejected.
pageNoWhere in the source: page, act or entry number (optional). Text value. JSON strings are accepted; JSON numbers are also accepted and sent as text.
isPrivateNoMark the citation private (default false).
attributesNoAttributes: JSON array of objects {type,value,...}, or strings "Type: Value" (first colon), or one string with lines or | between entries. A type must be a standard Gramps attribute type or a custom one the tree already uses; anything else is rejected with suggestions. Full grammar: gramps://input-guide. Each attribute takes only type, value and private.
confidenceNoHow reliable the cited record is: Very Low, Low, Normal (default), High or Very High.Normal
tagHandlesNoTags. Handles, not Gramps IDs: JSON array ["h1","h2"], one handle, or a comma/semicolon/newline-separated string; entries may also be objects {"ref":"…"}.
noteHandlesNoNotes, e.g. a transcript of the entry (create_note with type Transcript). Handles, not Gramps IDs: JSON array ["h1","h2"], one handle, or a comma/semicolon/newline-separated string; entries may also be objects {"ref":"…"}.
mediaHandlesNoMedia such as the scan of the page. Media handles, not Gramps IDs: JSON array ["h1","h2"], one handle, or a comma/semicolon/newline-separated string. To show only part of an image, such as one record on a page scan, give an object {"ref":"…","region":[left, top, right, bottom]} in place of the handle. A region is [left, top, right, bottom]: its edges in percent of the image width and height, 0 to 100, measured from the top-left corner; [10, 20, 60, 45] runs from 10% to 60% across and from 20% to 45% down. [0, 0, 100, 100] shows the whole image again; read_media with the same region shows what it covers. The object may also carry "attributes" of this link (not of the media), in the forms of the attributes argument, such as ["Page: 12"]; their types are checked like media attributes.
sourceHandleYesThe source being cited (required). Handle or Gramps ID (e.g. I0001), resolved automatically; find it with search or list_objects.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.10.0
    • changedInput schema / properties / mediaHandles / description
      Previous value: -"Media such as the scan of the page. Media handles, not Gramps IDs: JSON array [\"h1\",\"h2\"], one handle, or a comma/semicolon/newline-separated string. To show only part of an image, such as one record on a page scan, give an object {\"ref\":\"…\",\"region\":[left, top, right, bottom]} in place of the handle. A region is [left, top, right, bottom]: its edges in percent of the image width and height, 0 to 100, measured from the top-left corner; [10, 20, 60, 45] runs from 10% to 60% across and from 20% to 45% down. [0, 0, 100, 100] shows the whole image again; read_media with the same region shows what it covers."New value: +"Media such as the scan of the page. Media handles, not Gramps IDs: JSON array [\"h1\",\"h2\"], one handle, or a comma/semicolon/newline-separated string. To show only part of an image, such as one record on a page scan, give an object {\"ref\":\"…\",\"region\":[left, top, right, bottom]} in place of the handle. A region is [left, top, right, bottom]: its edges in percent of the image width and height, 0 to 100, measured from the top-left corner; [10, 20, 60, 45] runs from 10% to 60% across and from 20% to 45% down. [0, 0, 100, 100] shows the whole image again; read_media with the same region shows what it covers. The object may also carry \"attributes\" of this link (not of the media), in the forms of the attributes argument, such as [\"Page: 12\"]; their types are checked like media attributes."
  2. Changed1 schema field changedv2.5.1
    • changedInput schema / properties / mediaHandles / description
      Previous value: -"Media such as the scan of the page. Handles, not Gramps IDs: JSON array [\"h1\",\"h2\"], one handle, or a comma/semicolon/newline-separated string; entries may also be objects {\"ref\":\"…\"}."New value: +"Media such as the scan of the page. Media handles, not Gramps IDs: JSON array [\"h1\",\"h2\"], one handle, or a comma/semicolon/newline-separated string. To show only part of an image, such as one record on a page scan, give an object {\"ref\":\"…\",\"region\":[left, top, right, bottom]} in place of the handle. A region is [left, top, right, bottom]: its edges in percent of the image width and height, 0 to 100, measured from the top-left corner; [10, 20, 60, 45] runs from 10% to 60% across and from 20% to 45% down. [0, 0, 100, 100] shows the whole image again; read_media with the same region shows what it covers."
  3. Changed1 schema field changedv2.3.2
    • changedInput schema / properties / attributes / description
      Previous value: -"Attributes: JSON array of objects {type,value,...}, or strings \"Type: Value\" (first colon), or one string with lines or | between entries. Full grammar: gramps://input-guide. Each attribute takes only type, value and private."New value: +"Attributes: JSON array of objects {type,value,...}, or strings \"Type: Value\" (first colon), or one string with lines or | between entries. A type must be a standard Gramps attribute type or a custom one the tree already uses; anything else is rejected with suggestions. Full grammar: gramps://input-guide. Each attribute takes only type, value and private."
  4. Changed3 schema fields changedv2.3.1
    • changedInput schema / properties / attributes / description
      Previous value: -"Attributes: JSON array of objects {type,value,...}, or strings \"Type: Value\" (first colon), or one string with lines or | between entries. Full grammar: gramps://input-guide."New value: +"Attributes: JSON array of objects {type,value,...}, or strings \"Type: Value\" (first colon), or one string with lines or | between entries. Full grammar: gramps://input-guide. Each attribute takes only type, value and private."
    • changedInput schema / properties / noteHandles / description
      Previous value: -"Notes, e.g. a transcription. Handles, not Gramps IDs: JSON array [\"h1\",\"h2\"], one handle, or a comma/semicolon/newline-separated string; entries may also be objects {\"ref\":\"…\"}."New value: +"Notes, e.g. a transcript of the entry (create_note with type Transcript). Handles, not Gramps IDs: JSON array [\"h1\",\"h2\"], one handle, or a comma/semicolon/newline-separated string; entries may also be objects {\"ref\":\"…\"}."
    • removedInput schema / properties / text
      Removed value: -{
      -  "default": null,
      -  "description": "Citation text or transcript (optional).",
      -  "type": [
      -    "string",
      -    "null"
      -  ]
      -}
  5. Changed9 schema fields changedv2.3.0
    • changedInput schema / properties / confidence / description
      Previous value: -"Confidence: Very Low, Low, Normal, High, or Very High (default: Normal)"New value: +"How reliable the cited record is: Very Low, Low, Normal (default), High or Very High."
    • changedInput schema / properties / date / description
      Previous value: -"Access or reference date text. Date format: use ISO dates (1990-03-15), year-only (1920), or modifiers (before 1920, about 1950). Add the calendar at the end for Old Style and other calendars: 1856-07-20 (Julian). See gramps://input-guide resource or call get_reference(topic: \"input-guide\", section: \"dates\") for full syntax."New value: +"Date of the cited entry, optional. Date text: 1856-07-20, 1920-05, 1920, 1 Jul 1919, about/before/after 1920, 1800-1850, between … and …; append the calendar for other calendars, e.g. 1856-07-20 (Julian). Unreadable dates are rejected."
    • changedInput schema / properties / isPrivate / description
      Previous value: -"Mark record private (default: false)"New value: +"Mark the citation private (default false)."
    • changedInput schema / properties / mediaHandles / description
      Previous value: -"Media handles (optional). Handles: JSON array [\"h1\",\"h2\"], a single handle as a plain string, comma/semicolon/newline-separated list, or a JSON-array string. Array entries may be strings or objects {\"ref\":\"…\"} / {\"handle\":\"…\"}."New value: +"Media such as the scan of the page. Handles, not Gramps IDs: JSON array [\"h1\",\"h2\"], one handle, or a comma/semicolon/newline-separated string; entries may also be objects {\"ref\":\"…\"}."
    • changedInput schema / properties / noteHandles / description
      Previous value: -"Note handles (optional). Handles: JSON array [\"h1\",\"h2\"], a single handle as a plain string, comma/semicolon/newline-separated list, or a JSON-array string. Array entries may be strings or objects {\"ref\":\"…\"} / {\"handle\":\"…\"}."New value: +"Notes, e.g. a transcription. Handles, not Gramps IDs: JSON array [\"h1\",\"h2\"], one handle, or a comma/semicolon/newline-separated string; entries may also be objects {\"ref\":\"…\"}."
    • changedInput schema / properties / page / description
      Previous value: -"Page reference within source (optional). Text value. JSON strings are accepted; JSON numbers are also accepted and sent as text."New value: +"Where in the source: page, act or entry number (optional). Text value. JSON strings are accepted; JSON numbers are also accepted and sent as text."
    • changedInput schema / properties / sourceHandle / description
      Previous value: -"Source handle (required). Handle or Gramps ID (e.g. I0001). Handles are opaque strings from the API. Gramps IDs (like I0001, F0023) are auto-resolved to handles. Find handles with search() or list_objects()."New value: +"The source being cited (required). Handle or Gramps ID (e.g. I0001), resolved automatically; find it with search or list_objects."
    • changedInput schema / properties / tagHandles / description
      Previous value: -"Tag handles (optional). Handles: JSON array [\"h1\",\"h2\"], a single handle as a plain string, comma/semicolon/newline-separated list, or a JSON-array string. Array entries may be strings or objects {\"ref\":\"…\"} / {\"handle\":\"…\"}."New value: +"Tags. Handles, not Gramps IDs: JSON array [\"h1\",\"h2\"], one handle, or a comma/semicolon/newline-separated string; entries may also be objects {\"ref\":\"…\"}."
    • changedInput schema / properties / text / description
      Previous value: -"Citation text / transcript (optional)"New value: +"Citation text or transcript (optional)."
  6. First observedv2.2.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare write semantics, non-idempotency, and non-destructiveness; the description goes well beyond them by naming the return payload (new handle, Gramps ID, page), the attachment requirement via citationHandles/linkMode on update tools, and the authentication and throttling model ('need a Gramps Web account allowed to edit the tree'; locked or rate-limited writes fail with the delay to wait). That is exactly the operational context an agent needs before a non-idempotent write.

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?

Dense but front-loaded: purpose, return value, prerequisites, then attachment semantics, then error/auth behavior, then a pointer to the input guide. Every sentence carries information an agent would otherwise have to discover, though the single unbroken paragraph and the create_records aside make it heavier than strictly necessary.

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?

Nine parameters with only one required, no output schema, and no nested objects — normally a description would need to explain returns and validation. This one does: it names the return fields, notes date/attribute validation and rejection with suggestions, and points to get_reference for full argument grammar. Nothing an agent needs to call it correctly 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 100%, so the baseline is 3, but the description adds workflow meaning the schema cannot: noteHandles should carry a transcript created with create_note type Transcript, mediaHandles carries the scan (or a region-bearing object via create_media attachTo), and each handle type routes to a specific creation tool. It does not re-derive syntax already in the schema, which is the right choice.

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 precise verb and resource, then defines the resource concretely as 'one specific spot in an existing source, such as a page, act or entry number' and enumerates the fields it carries. This is clearly distinguishable from create_source (which makes the source) and update_citation (which changes one).

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?

Gives prerequisites ('The source must already exist (search, or create_source)'), names alternatives with conditions (update_citation for changes, create_records when several interlinked records are created together), and states the non-obvious when-not (no duplicate checking). The dependency that the citation is inert until attached to a person/family/event/place is spelled out explicitly.

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