audit_link
Check a declared join against the real data before trusting a query built on it. Give two table ids; each link between them is audited separately, labelled by its columns. The same id twice audits a table's self-links (there from is the link's first column: read from_columns).
max_fanout above 1 on both sides is a many-to-many that multiplies rows. orphans are what an INNER JOIN drops and a LEFT JOIN turns to NULLs; null_keys never match. Each side lists up to 50 offending key values, most rows first, to name to the user. from is table_id's side. A link whose column is gone or whose types no longer match returns unauditable with no counts: that is the finding, not an error.
lens: released audits the published cuts viewers see. If served mixes live and released, say so: orphans may just be the two sides at different times.
Each audit scans both tables in full, so at most 3 links are audited per call; not_audited lists the rest, and from_columns/to_columns pick one.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"table_id": "<table_id>",
"to_table_id": "<to_table_id>"
},
"name": "audit_link"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lens | No | `live` (default) or `released`. | |
| table_id | Yes | One side of the join. Either order works. | |
| to_columns | No | The far side's columns, positionally paired with `from_columns`. | |
| to_table_id | Yes | The other side — the table you want to join it against, or the same id again to audit that table's self-links. | |
| from_columns | No | Narrow to one link when the two tables have several. Column ids from `describe_table.links[].from_columns`, in that order. |