Skip to main content
Glama

Update Source

update_source
DestructiveIdempotent

Modify an existing genealogy source in Gramps Web: change title, author, publication info, abbreviation, attributes, repositories, notes, media or tags, leaving omitted fields unchanged.

Instructions

Change an existing source's title, author, publication info, abbreviation, attributes or links to repositories, notes, media and tags. For a new source use create_source; to remove one, delete_object; a page or act inside the source is a citation, changed with update_citation. repositoryHandles carry each repository's call number, so edit a call number with linkMode replace; attributes replace the whole list whatever linkMode says. 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 source returns a not-found message. 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
titleNoNew title. Omit to leave unchanged.
abbrevNoNew abbreviation. Omit to leave unchanged.
authorNoNew author. Omit to leave unchanged.
handleYesThe source to change. Handle or Gramps ID (e.g. I0001), resolved automatically; find it with search or list_objects.
pubinfoNoNew publication info. Omit to leave unchanged.
linkModeNoHow 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
isPrivateNotrue makes the record private, false public. Omit to leave unchanged.
attributesNoAttributes. Omit to keep; a value replaces the whole list and [] clears it, whatever linkMode says. 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.
tagHandlesNoTags. 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":"…"}.
noteHandlesNoNotes. 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":"…"}.
mediaHandlesNoMedia. Omit to keep; applied per linkMode. 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. A plain handle keeps the region its link has. In add mode a media already shown keeps its link and takes the region given; to show two regions of one image, list it twice, each with its region.
repositoryHandlesNoRepositories that hold the source. Omit to keep; applied per linkMode. 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. 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\":\"…\"}."New value: +"Media. Omit to keep; applied per linkMode. 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. A plain handle keeps the region its link has. In add mode a media already shown keeps its link and takes the region given; to show two regions of one image, list it twice, each with its region."
  2. Changed2 schema fields changedv2.3.2
    • changedInput schema / properties / attributes / description
      Previous value: -"Attributes. Omit to keep; a value replaces the whole list and [] clears it, whatever linkMode says. 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. Omit to keep; a value replaces the whole list and [] clears it, whatever linkMode says. 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. Omit to keep; applied per linkMode. 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. Omit to keep; applied per linkMode. 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. Changed2 schema fields changedv2.3.1
    • changedInput schema / properties / attributes / description
      Previous value: -"Attributes. Omit to keep; a value replaces the whole list and [] clears it, whatever linkMode says. 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. Omit to keep; a value replaces the whole list and [] clears it, whatever linkMode says. 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 / linkMode / description
      Previous value: -"How to apply all supplied link lists: replace (default) replaces each full list; 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."New value: +"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."
  4. Changed11 schema fields changedv2.3.0
    • changedInput schema / properties / abbrev / description
      Previous value: -"Abbreviation. Omit to leave unchanged."New value: +"New abbreviation. Omit to leave unchanged."
    • changedInput schema / properties / attributes / description
      Previous value: -"Replace attributes. Omit to leave unchanged. For link lists, linkMode controls replace/add/remove; [] clears in replace mode and does nothing in add/remove. Other lists always use replacement. 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. Omit to keep; a value replaces the whole list and [] clears it, whatever linkMode says. 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."
    • changedInput schema / properties / author / description
      Previous value: -"Author. Omit to leave unchanged."New value: +"New author. Omit to leave unchanged."
    • changedInput schema / properties / handle / description
      Previous value: -"Source handle. 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 to change. Handle or Gramps ID (e.g. I0001), resolved automatically; find it with search or list_objects."
    • changedInput schema / properties / isPrivate / description
      Previous value: -"Private flag. Omit to leave unchanged."New value: +"true makes the record private, false public. Omit to leave unchanged."
    • changedInput schema / properties / mediaHandles / description
      Previous value: -"Linked media. Omit to leave unchanged. For link lists, linkMode controls replace/add/remove; [] clears in replace mode and does nothing in add/remove. Other lists always use replacement. 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. 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\":\"…\"}."
    • changedInput schema / properties / noteHandles / description
      Previous value: -"Linked notes. Omit to leave unchanged. For link lists, linkMode controls replace/add/remove; [] clears in replace mode and does nothing in add/remove. Other lists always use replacement. 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. 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\":\"…\"}."
    • changedInput schema / properties / pubinfo / description
      Previous value: -"Publication info. Omit to leave unchanged."New value: +"New publication info. Omit to leave unchanged."
    • changedInput schema / properties / repositoryHandles / description
      Previous value: -"Repository refs. Omit to leave unchanged. For link lists, linkMode controls replace/add/remove; [] clears in replace mode and does nothing in add/remove. Other lists always use replacement. 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. Omit to keep; applied per linkMode. 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: -"Linked tags. Omit to leave unchanged. For link lists, linkMode controls replace/add/remove; [] clears in replace mode and does nothing in add/remove. Other lists always use replacement. 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. 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\":\"…\"}."
    • changedInput schema / properties / title / description
      Previous value: -"Title. Omit to leave unchanged."New value: +"New title. Omit to leave unchanged."
  5. 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 declare destructive/idempotent/write, but the description adds substantial context beyond them: write serialization ('one at a time'), the account permission requirement, lock/rate-limit failure with a retry delay, the not-found response, and the destructive edge case that [] in replace mode removes every link of that kind. That is well past what the structured fields convey.

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 alternatives, dense but mostly earning its length for a 12-parameter mutation tool. Some material (linkMode mechanics) duplicates the schema text, and the final grammar pointer is a mild tail, so it is not perfectly tight.

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 complex mutation tool with no output schema, it covers return values (handle and Gramps ID), error cases (not found, locked/rate-limited), and authorization requirements. An agent has everything needed to call it correctly.

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 per-field baseline is 3, but the description adds cross-parameter semantics the schema only states per-field: repositoryHandles carry the call number so call numbers are edited via linkMode replace, and attributes replace the whole list regardless of linkMode. These interaction rules are genuinely additive, though the linkMode explanation largely restates the schema's own detailed description.

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 (change/update) plus resource (existing source) and enumerates the editable facets (title, author, pubinfo, abbreviation, attributes, links, notes, media, tags). It actively distinguishes itself from create_source, delete_object, and update_citation, so an agent can tell the boundary without opening a 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?

Explicitly routes to alternatives: create_source for a new one, delete_object to remove, update_citation for a page/act inside the source. It also states the partial-update contract ('Pass only what changes; omitted arguments stay as they are') and that forms live in get_reference, leaving little to inference.

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