Update Repository
update_repositoryChange an existing repository's name, type, addresses, website, links, notes, or tags while leaving omitted fields unchanged. Use it to correct repository details after creation.
Instructions
Change an existing repository's name, type, address, website or links to notes and tags. For a new repository use create_repository; to remove one, delete_object. Which sources it holds, with their call numbers, is stored on the sources: change that with update_source (repositoryHandles), not here. addresses sets street, city, postal code, country and the other address fields, and urls sets links with their type and description; address is a shortcut for a single address with only a street line, and url for a single Web Home link. Each replaces every stored address or link; an empty address or url string, or addresses or urls [], removes them. A change shows on every source that lists the repository. Pass only what changes; omitted arguments stay as they are. Link lists (…Handles, …Refs) follow linkMode: replace (default) sets the whole list, add appends, remove drops the given handles; in replace mode [] REMOVES every link of that kind, though the linked records themselves stay in the tree. Returns the handle and Gramps ID; a missing repository returns a not-found message, and an unknown type is rejected before anything is saved. 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.
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": {
"handle": "<handle>"
},
"name": "update_repository"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | New website, stored as a single Web Home link; replaces every stored link, and an empty string removes them. Omit to leave unchanged. | |
| name | No | New name. Omit to leave unchanged. | |
| urls | No | Links with a type and an optional description, e.g. "Web Home: https://archive.example.org — reading room\nE-mail: info@archive.example.org". URLs: JSON array of {type,path,desc}, or strings "Web Home: https://…" with optional " — note" after URL, or lines/| separated. A type must be a standard Gramps URL type (E-mail, Web Home, Web Search, FTP, Unknown) or a custom one the tree already uses. Grammar: gramps://input-guide. Not together with url. Omit to keep; a value replaces the whole list and [] clears it, whatever linkMode says. | |
| handle | Yes | The repository to change. Handle or Gramps ID (e.g. I0001), resolved automatically; find it with search or list_objects. | |
| address | No | New postal address as one line, stored as the street of a single address; replaces every stored address, and an empty string removes them. Omit to leave unchanged. | |
| linkMode | No | How to apply all supplied link lists: replace (default) replaces each full list, and a link it keeps keeps its stored privacy, citations, notes and crop unless the call sends new values; add appends missing handles and preserves existing link metadata; remove removes all links matching supplied handles (reference metadata is ignored). Omitted lists stay unchanged; empty lists clear only in replace mode. Does not affect attributes, names, addresses or URLs. Use separate calls to add and remove, or replace to edit existing link metadata. | replace |
| repoType | No | New type, e.g. Archive, Library, Church. Omit to leave unchanged. Must be a standard Gramps type or a custom one the tree already uses; anything else is rejected with suggestions. List: get_reference(topic: "types"). | |
| addresses | No | Postal addresses with separate fields, e.g. "street: 12 High Street\ncity: London\npostal: SW1A 1AA\ncountry: United Kingdom". Addresses: JSON array of Gramps address objects; or text blocks with lines like street:, city:, … (blank line or --- between addresses); or one plain line = street only. Grammar: gramps://input-guide. Not together with address. Omit to keep; a value replaces the whole list and [] clears it, whatever linkMode says. | |
| isPrivate | No | true makes the record private, false public. Omit to leave unchanged. | |
| tagHandles | No | Tags. Omit to keep; applied per linkMode. 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. Omit to keep; applied per linkMode. Handles, not Gramps IDs: JSON array ["h1","h2"], one handle, or a comma/semicolon/newline-separated string; entries may also be objects {"ref":"…"}. |