Create Source
create_sourceCreate a source: a book, register, archive unit or website that facts come from, with title, author, publication info and the repositories that hold it (with call numbers). Returns the new handle, Gramps ID and title, with next steps.
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 (with call numbers). Returns the new handle, Gramps ID and title, with next steps. Does not check for duplicates: search for the source first. A source alone proves nothing: cite a page or act of it with create_citation, then attach that citation to people and events. Change an existing source with update_source. Formats of every argument: get_reference(topic: "input-guide").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Title (required). | |
| abbrev | No | Short title for lists (optional). | |
| author | No | Author or issuing body (optional). | |
| pubinfo | No | Publication info: publisher, place, year (optional). | |
| isPrivate | No | Mark the source private (default false). | |
| attributes | No | 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. | |
| tagHandles | No | Tags. Handles, not Gramps IDs: JSON array ["h1","h2"], one handle, or a comma/semicolon/newline-separated string; entries may also be objects {"ref":"…"}. | |
| noteHandles | No | Notes. Handles, not Gramps IDs: JSON array ["h1","h2"], one handle, or a comma/semicolon/newline-separated string; entries may also be objects {"ref":"…"}. | |
| mediaHandles | No | Media. Handles, not Gramps IDs: JSON array ["h1","h2"], one handle, or a comma/semicolon/newline-separated string; entries may also be objects {"ref":"…"}. | |
| repositoryHandles | No | 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. |