diagnostics#
Diagnostic commands inspect the index for inconsistencies without modifying it. They are intended to help clients surface problems to the user in real time.
diagnostics/links#
Scans the links recorded for a given note and returns any that point to a slug that does not exist in the index. Intended to be called after a note is saved or opened so clients can display inline warnings.
Method: diagnostics/links
Params:
| Field | Type | Description |
|---|---|---|
path | string | Absolute path to the note to check. |
Request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "diagnostics/links",
"params": {
"path": "~/vault/worklogs/dendrite-is-helping-my-workflow.md"
}
}Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"noteId": "019063a1-...",
"notePath": "~/vault/worklogs/dendrite-is-helping-my-workflow.md",
"line": 7,
"col": 3,
"raw": "[[missing-note]]",
"target": "missing-note",
"message": "broken link: target 'missing-note' not found in index"
}
]
}An empty array means all links in the note resolve correctly. Each entry includes the position of the broken link within the file so the client can display it inline.
| Field | Type | Description |
|---|---|---|
noteId | string | UUID of the note being checked. |
notePath | string | Path to the note being checked. |
line | number | Line number of the broken link (1-based). |
col | number | Column offset of the broken link (0-based). |
raw | string | The original link text as it appears in the file. |
target | string | The slug the link resolves to. |
message | string | Human-readable description of the problem. |