MD_GET_GUIDE
Preview
This feature is in preview and is subject to change.
Read a Guide's full markdown content by ID, optionally at a specific historical version.
Syntax
SELECT * FROM MD_GET_GUIDE(id = '<guide_uuid>');
-- Read a specific version
SELECT * FROM MD_GET_GUIDE(id = '<guide_uuid>', version = 2);
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | UUID | Yes | The guide's UUID, as returned by MD_LIST_GUIDES or MD_CREATE_GUIDE. |
version | UINTEGER | No | Historical version number to read. Defaults to the current version. |
Return columns
| Column | Type | Description |
|---|---|---|
id | UUID | Unique identifier of the guide |
topic | VARCHAR | Grouping label (NULL for guides without a topic) |
title | VARCHAR | Guide title |
description | VARCHAR | One-line summary |
owner_id | UUID | UUID of the guide owner |
owner_name | VARCHAR | Name of the guide owner |
access | VARCHAR | 'user' (private) or 'organization' (org-wide) |
current_version | UINTEGER | Latest version number |
created_at | TIMESTAMP WITH TIME ZONE | When the guide was created |
updated_at | TIMESTAMP WITH TIME ZONE | When the guide was last updated |
version | UINTEGER | The version being read |
version_change_comment | VARCHAR | Note for this version |
version_external_id | VARCHAR | Caller-provided version ID |
version_created_at | TIMESTAMP WITH TIME ZONE | When this version was created |
references | STRUCT[] | Structured references attached to this version. Guide, Dive, and Flight references resolve to guide_id, dive_id, and flight_id UUIDs. |
content | VARCHAR | Full markdown content |
Examples
Read the current version of a guide:
SELECT topic, title, content
FROM MD_GET_GUIDE(id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890');
Read version 2 of a guide:
SELECT version, version_change_comment, content
FROM MD_GET_GUIDE(
id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
version = 2
);
Related
MD_LIST_GUIDES— Find a guide's ID.MD_LIST_GUIDE_VERSIONS— Browse a guide's version history.MD_UPDATE_GUIDE— Append a version.get_guideMCP tool — AI assistant equivalent.