Skip to main content
Glama
ianderso
by ianderso

detach_object

Destructive

Remove a reference from a Gramps object, such as an event from a person or a child from a family, without deleting the detached record. Optionally delete it if orphaned.

Instructions

Remove a reference from an object: an event from a person, an image from a source, a tag, a note, a child from a family.

The reference is removed; the object itself survives unless delete_if_orphan is set AND nothing else points at it -- which is checked, because deleting something other facts still reference leaves dangling handles behind.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
childYesHandle or gramps_id of the thing to detach; a tag may be given by name.
parentYesIts handle or gramps_id.
child_kindYesWhat to detach: event, media, note, tag (removes a tag), citation, child (a person from a family), person (a person_ref), repository, enclosure (a parent of a place), or -- on a person, to repair a link only the person holds (check_family_links) -- parent_family or family.
call_numberNoRepository only: detach just the link with this call number, when a source is held twice in one repository. Omit to detach every link.
parent_typeYesType of the object holding the reference.
delete_if_orphanNoAlso delete the detached object if nothing else references it. Off by default -- detaching and deleting are different decisions.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.0.1
    • addedInput schema / properties / call_number
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Repository only: detach just the link with this call number, when a source is held twice in one repository. Omit to detach every link."
      +}
    • changedInput schema / properties / child / description
      Previous value: -"Handle or gramps_id of the thing to detach."New value: +"Handle or gramps_id of the thing to detach; a tag may be given by name."
    • changedInput schema / properties / child_kind / description
      Previous value: -"What to detach: event, media, note, tag, citation, child (a person from a family), person (a person_ref), or repository."New value: +"What to detach: event, media, note, tag (removes a tag), citation, child (a person from a family), person (a person_ref), repository, enclosure (a parent of a place), or -- on a person, to repair a link only the person holds (check_family_links) -- parent_family or family."
  2. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=false, so the safety profile is covered. The description goes beyond that by disclosing the orphan-check semantics: deletion only happens when delete_if_orphan is set AND nothing else references the object, precisely because dangling handles would otherwise result. It does not cover permissions or what the response looks like.

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 core action and its scope are front-loaded in the first sentence, with the destructive edge case in the second. The em-dash clause is slightly ornate but every sentence carries load; no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a six-parameter, four-required mutation tool with no output schema, the definition covers the action, the supported relationship kinds and the one genuinely risky flag. It never explains parent_type's valid values or the relationship to check_family_links beyond a passing reference in the schema, which is a minor gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, including per-parameter docs for child_kind, call_number and delete_if_orphan. The prose restates the detach-vs-delete distinction but adds no syntax or format detail beyond what the schema already supplies, so the baseline of 3 is right.

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 ('Remove a reference from an object') and immediately enumerates concrete cases: event from person, image from source, tag, note, child from family. It also implicitly separates itself from delete_object by asserting 'the object itself survives,' so an agent can distinguish the two without opening schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

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

There is real usage guidance embedded ('detaching and deleting are different decisions', delete_if_orphan is off by default), but no sibling is ever named. With uncite, delete_object, update_child_ref and move_child all in scope, the agent must infer which to pick rather than being routed.

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