Skip to main content
Glama
ianderso
by ianderso

link_repository

Attach an existing repository to an existing source to record where it is held, with an optional call number. Duplicate links are skipped.

Instructions

Link an existing source to an existing repository that holds it.

Adds a repository reference (with an optional call number) to the source. Both objects must already exist. Duplicate links to the same repository are skipped.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYesSource handle or gramps_id (e.g. 'S0001').
media_typeNoMedium of the source at the repository, e.g. 'Book', 'Film', 'Electronic', 'Unknown'.Unknown
repositoryYesRepository handle or gramps_id (e.g. 'R0001').
call_numberNoCall number / reference within the repository.
allow_new_typeNoAccept a type that is neither a Gramps standard type nor one of the tree's custom types, creating it as a new custom type. Only when meant: a near-miss is refused with the closest names.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.2.0
    • addedInput schema / properties / allow_new_type
      Added value: +{
      +  "default": false,
      +  "description": "Accept a type that is neither a Gramps standard type nor one of the tree's custom types, creating it as a new custom type. Only when meant: a near-miss is refused with the closest names.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / media_type / description
      Previous value: -"Medium of the source at the repository, e.g. 'Book', 'Microfilm', 'Electronic', 'Unknown'."New value: +"Medium of the source at the repository, e.g. 'Book', 'Film', 'Electronic', 'Unknown'."
  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 the safety profile (readOnly=false, destructive=false, openWorld=false), so the bar is lower. The description still adds genuine value: it discloses the mutation target ('adds a repository reference ... to the source'), a precondition failure mode (both objects must exist), and duplicate-handling behavior. Minor tension: 'duplicate links ... are skipped' reads as idempotent for repeated identical calls, while idempotentHint=false suggests otherwise.

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?

Three short sentences, front-loaded with the core action, then scope, then the two behavioral caveats. No filler. The second sentence slightly restates the first ('adds a repository reference to the source') but earns its place by naming the optional call number.

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 mutating link operation with no output schema, the description covers the essential points an agent needs: both objects must pre-exist, the link is added to the source, duplicates are skipped. It does not spell out error behavior when a handle is invalid or whether the source's updated state is returned, but nothing critical to invoking it correctly is missing.

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%, so every parameter (source, repository, media_type, call_number, allow_new_type) is already documented in the schema. The description only echoes 'optional call number' and the repository reference, adding no syntax, format, or defaulting detail beyond what the schema provides. Baseline 3 applies.

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+resource+relationship: link an existing source to an existing repository that holds it. This is unambiguous and distinguishable from add_repository (creates the repository) and link_repositories (plural, likely bulk). An agent knows exactly what operation this performs without opening the schema.

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?

Provides a real prerequisite ('Both objects must already exist') and a behavior on repeat use ('Duplicate links ... are skipped'), which is useful context. However, it never says when to prefer this over the near-identical sibling link_repositories, nor when linking is the right move versus citing or updating the source directly. Usage is implied rather than guided.

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