Skip to main content
Glama

ensure_link_by_query

Resolve an experiment or item by query and idempotently link it to a target record, returning candidates instead of guessing when the matches are ambiguous.

Instructions

Resolve the target entity by query and then link it idempotently. Query resolution works for experiments and items only. WRITE OPERATION when dry_run=false — requires the link write scope. With several matches the tool returns the candidates instead of guessing (on_ambiguous='error' makes it fail instead).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qNo
tagsNo
scopeNoall
offsetNo
dry_runNo
from_idYes
to_typeYes
extendedNo
trace_idNo
from_typeYes
owner_idsNo
status_idsNo
category_idsNo
on_ambiguousNoreturn_candidates
limit_candidatesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does a credible job: it flags a WRITE OPERATION, names the required link write scope, states idempotency, and explains ambiguity handling instead of silently guessing. It omits failure/error semantics beyond ambiguity and doesn't describe the dry-run preview return, but the safety-critical traits are covered.

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?

Four tight sentences, front-loaded with the core action and then the constraints that matter most (capability limits, write scope, ambiguity policy). No filler or restatement of the name.

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

Completeness3/5

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

The mutation and ambiguity behavior are well covered, and an output schema exists so return values need not be explained. However, 15 parameters with 0% schema coverage leaves the bulk of the input contract undocumented, which is a substantial gap for a tool this wide.

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

Parameters2/5

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

Schema description coverage is 0% across 15 parameters, so the description must compensate and largely does not. It explains q, dry_run, and on_ambiguous, but leaves the filter params (tags, scope, owner_ids, status_ids, category_ids, offset, limit_candidates) and the from/to typing params entirely undocumented in both schema and description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific compound verb+resource: resolve an entity by query, then link it idempotently. The scope constraint ('works for experiments and items only') meaningfully narrows what the tool can target. It does not explicitly contrast itself with the sibling `ensure_link` (link by explicit id) or `resolve_entity_by_query`, so the differentiation is only implied rather than stated.

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?

Gives real conditional guidance: query resolution only applies to experiments and items, dry_run=false is when the write actually happens, and on_ambiguous controls ambiguity handling. It stops short of saying when to choose this over `ensure_link` or `bulk_ensure_links`, so alternatives are left to inference.

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