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. The object survives unless delete_if_orphan is set and nothing else references it.

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.
parentYesIts handle or gramps_id.
child_kindYesWhat to detach: event, media, note, tag, citation, child (a person from a family), person (a person_ref), or repository.
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. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=false. The description adds substantial behavioral context beyond annotations: the referenced object survives by default, deletion only happens if delete_if_orphan is set AND no other references point to it, and this orphan check exists to avoid dangling handles. That is exactly the kind of operational nuance an agent needs for a destructive mutation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short paragraphs, front-loaded with the core purpose and then the critical conditional-deletion behavior. Every sentence carries information; there is no filler or repetition.

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 destructive mutation tool with no output schema, the description covers the essential behavior: references are removed, objects survive by default, and deletion is conditional and checked. It does not describe failure modes such as a missing reference, but the annotations and schema carry enough of the remaining burden that the definition is largely complete.

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 description coverage is 100%, so the baseline is 3. The description reinforces the child_kind examples and, more importantly, explains the rationale and guard condition behind delete_if_orphan beyond the schema's wording ('which is checked, because deleting something other facts still reference leaves dangling handles behind'). This adds useful semantic depth, though most parameter detail still lives in the schema.

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?

The description states a specific verb and resource: remove a reference from an object, with concrete examples (event from person, image from source, tag, note, child from family). It clearly distinguishes detaching from deleting an object, so an agent can differentiate it from sibling tools like delete_object or uncite 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 Guidelines4/5

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

The description gives clear context for when to use this tool: to remove a reference while preserving the underlying object. It also explains the conditional delete_if_orphan behavior, which helps distinguish detaching from deleting. However, it does not explicitly name alternative tools or state when-not to use this tool versus siblings.

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