Skip to main content
Glama

Create Source

create_source

Create a source record for a book, register, archive unit, or website that facts come from, with title, author, publication details, and repositories holding it.

Instructions

Create a source: a book, register, archive unit or website that facts come from, with title, author, publication info and the repositories that hold it. Search for the source first: no duplicate check is made, and an existing source is changed with update_source. repositoryHandles takes existing repositories only (create_repository), each with the source's call number there. The arguments split a reference: title names the document, such as a parish register for one year; author is who made it; pubinfo is for a published work; abbrev is a short title for lists; the archive's shelf mark, such as fond, inventory and file, is the call number on repositoryHandles, with the media type (Book, Manuscript, Film, Electronic …) the archive holds it in; the page, frame or entry goes on the citation. Notes and media here describe the whole source; the scan of one entry belongs on its citation. A source alone proves nothing: cite a page or act of it with create_citation, then attach that citation to people and events. Returns the new handle, Gramps ID and title, with next steps. 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").

Input Schema

NameRequiredDescriptionDefault
titleYesTitle (required).
abbrevNoShort title for lists (optional).
authorNoAuthor or issuing body (optional).
pubinfoNoPublication info: publisher, place, year (optional).
isPrivateNoMark the source 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.
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. Handles, not Gramps IDs: JSON array ["h1","h2"], one handle, or a comma/semicolon/newline-separated string; entries may also be objects {"ref":"…"}.
mediaHandlesNoMedia. 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.
repositoryHandlesNoRepositories that hold the source, each with an optional call number and media type; the repositories must exist (create_repository). Repository refs (handles, not Gramps IDs): JSON array of GrampsRepositoryRef objects, or strings "Ref : CallNumber : MediaType". JSON objects accept Gramps snake_case (call_number, media_type) or camelCase (callNumber, mediaType). Parts after Ref are optional: "Ref : CallNumber" and "Ref :: MediaType" are valid. MediaType must be a standard Gramps source media type (Book, Manuscript, Film, Photo, …) or a custom one the tree already uses. Multiple refs: JSON array or one multiline / |-separated string.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.5.1
    • changedInput schema / properties / mediaHandles / description
      Previous value: -"Media. 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. 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."
  2. Changed2 schema fields 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."
    • changedInput schema / properties / repositoryHandles / description
      Previous value: -"Repositories that hold the source, each with an optional call number and media type; the repositories must exist (create_repository). Repository refs (handles, not Gramps IDs): JSON array of GrampsRepositoryRef objects, or strings \"Ref : CallNumber : MediaType\". JSON objects accept Gramps snake_case (call_number, media_type) or camelCase (callNumber, mediaType). Parts after Ref are optional: \"Ref : CallNumber\" and \"Ref :: MediaType\" are valid. Multiple refs: JSON array or one multiline / |-separated string."New value: +"Repositories that hold the source, each with an optional call number and media type; the repositories must exist (create_repository). Repository refs (handles, not Gramps IDs): JSON array of GrampsRepositoryRef objects, or strings \"Ref : CallNumber : MediaType\". JSON objects accept Gramps snake_case (call_number, media_type) or camelCase (callNumber, mediaType). Parts after Ref are optional: \"Ref : CallNumber\" and \"Ref :: MediaType\" are valid. MediaType must be a standard Gramps source media type (Book, Manuscript, Film, Photo, …) or a custom one the tree already uses. Multiple refs: JSON array or one multiline / |-separated string."
  3. Changed1 schema field 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."
  4. Changed8 schema fields changedv2.3.0
    • changedInput schema / properties / abbrev / description
      Previous value: -"Abbreviation (optional)"New value: +"Short title for lists (optional)."
    • changedInput schema / properties / author / description
      Previous value: -"Author name (optional)"New value: +"Author or issuing body (optional)."
    • changedInput schema / properties / isPrivate / description
      Previous value: -"Mark record private (default: false)"New value: +"Mark the source 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. 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. 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 / pubinfo / description
      Previous value: -"Publication info (optional)"New value: +"Publication info: publisher, place, year (optional)."
    • changedInput schema / properties / repositoryHandles / description
      Previous value: -"Repository refs. Repository refs: JSON array of GrampsRepositoryRef objects, or strings \"Ref : CallNumber : MediaType\". JSON objects accept Gramps snake_case (call_number, media_type) or camelCase (callNumber, mediaType). Parts after Ref are optional: \"Ref : CallNumber\" and \"Ref :: MediaType\" are valid. Multiple refs: JSON array or one multiline / |-separated string."New value: +"Repositories that hold the source, each with an optional call number and media type; the repositories must exist (create_repository). Repository refs (handles, not Gramps IDs): JSON array of GrampsRepositoryRef objects, or strings \"Ref : CallNumber : MediaType\". JSON objects accept Gramps snake_case (call_number, media_type) or camelCase (callNumber, mediaType). Parts after Ref are optional: \"Ref : CallNumber\" and \"Ref :: MediaType\" are valid. Multiple refs: JSON array or one multiline / |-separated string."
    • 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\":\"…\"}."
  5. First observedv2.2.0

TDQS

A4.4/5.0
Behavior3/5

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

Annotations give the safety profile (readOnlyHint=false, destructiveHint=false, idempotentHint=false), so the bar is lower. Credit is due for disclosing that no duplicate check runs, that writes are serialized one at a time, that a locked or rate-limited write returns the delay to wait, and what the response contains (handle, Gramps ID, title, next steps).

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?

The definition is front-loaded and every paragraph carries distinct content. It is dense and long, though: the repositoryHandles and media-type material overlaps the schema's own text, and the closing pointer to get_reference(topic: "input-guide") partly duplicates the gramps://input-guide reference already inside the schema.

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 10-parameter mutation with no output schema, the description covers what an agent needs: what the record represents, how the free-text arguments map onto a reference, which handles must pre-exist, the return value, and the failure modes. Nothing essential to invoking it correctly is left out.

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 real conceptual mapping beyond the field docs: title names the document, author is who made it, pubinfo is for published works, abbrev is the list title, and the archive shelf mark (fond/inventory/file) becomes the call number carried on repositoryHandles. It also disambiguates scope, noting that notes and media here describe the whole source while the scan of one entry belongs on the citation.

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 and resource and then defines the resource itself ("a book, register, archive unit or website that facts come from"), which an agent cannot get from the name alone. It also names the sibling that handles the modify case (update_source) and the batch case (create_records), so the tool is distinguishable 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 Guidelines5/5

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

Explicit when-to-use and when-not: search first because no duplicate check is made, use update_source to change an existing source, use create_repository for repositories, use create_records when several interlinked records must be created atomically, and follow with create_citation. Prerequisites (edit-permitted Gramps Web account) are also stated.

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