Skip to main content
Glama

Find referenced object

find_ref
Read-onlyIdempotent

Locate the table holding a UUID as its primary key when no foreign key link exists. Searches the hint table, column-named tables, then all tables.

Instructions

Find which table holds a UUID value as its primary key — for schemas that store references as UUIDs without foreign keys (1C-style Ref keys, columns like SenderAddress or Owner_Ref). Use it when describe shows no fk for a column whose values are UUIDs; use describe fk + query instead when real foreign keys exist. Searches tables whose single-column primary key can hold a UUID: the hint table first, then tables named like the column (SenderAddress → …Addresses), then all of them. Returns matches[N]{table,pk,label} (label = Description/Name/Number/Code of the row) and found_by, or searched_tables when nothing matched. On failure returns isError with 'error: ' (e.g. refused statement, unknown table, SQL error).

Input Schema

NameRequiredDescriptionDefault
hintNoOptional: value of a sibling type column such as Owner_TRef = 'Catalog.Counterparties'.
tableNoOptional: table the value was read from (improves the guess and is remembered).
valueYesThe UUID to look up, e.g. 7e6056b9-9582-11f1-a74c-005056bd6036.
columnNoOptional: column the value was read from, e.g. SenderAddress.
databaseNoOptional database to use instead of the connection's default (names from `databases`). Omit to use the default.
connectionYesConnection name exactly as returned by `connections` (e.g. "shop"). Unknown or unexposed names return an error.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.5

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint/idempotentHint/destructiveHint=false, but the description adds substantial behavioral detail beyond them: the ordered search strategy (hint table, then name-matched tables, then all), the exact return shape (matches[N]{table,pk,label}, found_by, searched_tables), and the failure contract (isError with 'error: <reason>').

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 the use/avoid decision, then search order, then return shape — an efficient ordering. It is dense and long, but nearly every clause carries actionable information; the parenthetical examples are the only mildly expendable material.

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?

With no output schema defined, the description fully compensates by documenting return fields and the error path, and it covers the when-to-use decision a 6-parameter (2 required) lookup tool needs. Nothing an agent requires to call it correctly is missing.

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 baseline is 3, but the description adds real meaning: that `table` improves the guess and is remembered, that `hint` is a sibling type-column value, and how the column name drives table-name matching (SenderAddress → …Addresses).

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 (find), resource (UUID primary-key reference), and scope (schemas storing UUID refs without FKs, with concrete examples like Ref keys, SenderAddress, Owner_Ref). It explicitly distinguishes itself from the `describe` fk + `query` path, so an agent can route correctly without opening another 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?

Gives an explicit trigger ('when `describe` shows no fk for a column whose values are UUIDs') and an explicit anti-case ('use describe fk + query instead when real foreign keys exist'), naming the sibling tools to use instead. Nothing is left to inference.

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