:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(prompts): document reference behavior on the mcp prompt tools (#105656)
Juraj Majerik0abdbde1bb5c
diff --git a/products/ai_observability/mcp/tools.yaml b/products/ai_observability/mcp/tools.yamlindex 61d90e78304c..98aa5623c362 100644--- a/products/ai_observability/mcp/tools.yaml+++ b/products/ai_observability/mcp/tools.yaml@@ -917,6 +917,12 @@ tools:or `content=preview` for a short `prompt_preview` snippet instead of the full prompt.With full content the response also includes `config`, the JSON object of model parameters or agentconfiguration stored with the version (null when the version has none).+ Prompt content can contain `@@@prompt:...@@@` references to other prompts. By default the response is+ the assembled content with each reference replaced by the referenced prompt's content, and+ `resolved_references` lists the exact versions spliced in. Pass `resolve=false` to get the raw text+ with the tags intact — always do this before editing the prompt (see llma-prompt-update).+ References are rolling out gradually: when not enabled for the team, responses return the raw tags+ and no `resolved_references`, so treat content containing `@@@prompt:` as unresolved.param_overrides:prompt_name:aliases:@@ -975,6 +981,10 @@ tools:are omitted. Returns paginated prompt summaries. By default, only prompt metadata is returned, not fullprompt content. Every result also includes `outline`, a flat list of markdown headings parsed from theprompt — use it as a lightweight table of contents, and pair with `content=none` to keep responses small.+ With `label` and `content=full`, prompt content is returned with `@@@prompt:...@@@` references resolved and+ `resolved_references` listing the spliced versions; unlabeled listings return raw content with any reference+ tags intact. Reference resolution is rolling out gradually and returns raw tags when not enabled for the+ team.llma-prompt-resolve:operation: llm_prompts_resolve_name_retrieveenabled: false@@ -1000,6 +1010,10 @@ tools:Pass 'config' (a JSON object) to set model parameters or agent configuration on the new version.If 'config' is omitted the current version's config is carried forward; pass null to clear it.A config-only publish (no 'prompt' or 'edits') keeps the prompt content unchanged.+ If the prompt contains `@@@prompt:...@@@` references, fetch it with `resolve=false` first and edit+ that raw text: the default llma-prompt-get response inlines the referenced prompts, so republishing+ it replaces the references with flattened copies that stop following label moves. 'edits' written+ against resolved content also fail to match, because the stored content keeps the tags.include_params:- prompt- editsdiff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.jsonindex 548a636d9941..291b87ba4aa2 100644--- a/services/mcp/schema/generated-tool-definitions.json+++ b/services/mcp/schema/generated-tool-definitions.json@@ -7247,7 +7247,7 @@}},"llma-prompt-get": {- "description": "Get a specific LLM prompt by name. Requires `prompt_name`, which takes either the prompt's exact name or\nthe `id` UUID from any llma-prompt-list or llma-prompt-get response. Call llma-prompt-list to discover\nvalid names; a guessed name that matches nothing returns a 404.\nAn id identifies the prompt, not the version it came from, so passing a specific version's id still\nreturns the latest version. Pass `version` or `label` to pin one.\nUses the cached endpoint for fast retrieval.\nPass `label` (e.g. 'production') to fetch the version that label currently points to, or `version` for an\nexact version number — not both. With neither, the latest version is returned.\nThe response always includes `outline`, a flat list of markdown headings parsed from the prompt — useful\nas a lightweight table of contents. Pass `content=none` to get the outline without the prompt payload,\nor `content=preview` for a short `prompt_preview` snippet instead of the full prompt.\nWith full content the response also includes `config`, the JSON object of model parameters or agent\nconfiguration stored with the version (null when the version has none).",+ "description": "Get a specific LLM prompt by name. Requires `prompt_name`, which takes either the prompt's exact name or\nthe `id` UUID from any llma-prompt-list or llma-prompt-get response. Call llma-prompt-list to discover\nvalid names; a guessed name that matches nothing returns a 404.\nAn id identifies the prompt, not the version it came from, so passing a specific version's id still\nreturns the latest version. Pass `version` or `label` to pin one.\nUses the cached endpoint for fast retrieval.\nPass `label` (e.g. 'production') to fetch the version that label currently points to, or `version` for an\nexact version number — not both. With neither, the latest version is returned.\nThe response always includes `outline`, a flat list of markdown headings parsed from the prompt — useful\nas a lightweight table of contents. Pass `content=none` to get the outline without the prompt payload,\nor `content=preview` for a short `prompt_preview` snippet instead of the full prompt.\nWith full content the response also includes `config`, the JSON object of model parameters or agent\nconfiguration stored with the version (null when the version has none).\nPrompt content can contain `@@@prompt:...@@@` references to other prompts. By default the response is\nthe assembled content with each reference replaced by the referenced prompt's content, and\n`resolved_references` lists the exact versions spliced in. Pass `resolve=false` to get the raw text\nwith the tags intact — always do this before editing the prompt (see llma-prompt-update).\nReferences are rolling out gradually: when not enabled for the team, responses return the raw tags\nand no `resolved_references`, so treat content containing `@@@prompt:` as unresolved.","category": "AI observability","feature": "llm_analytics","summary": "Get prompt",@@ -7289,7 +7289,7 @@}},"llma-prompt-list": {- "description": "List all LLM prompts stored for the current team. Optionally filter by name. Pass `label` (e.g. 'production') to get each prompt at the version that label currently points to; prompts without that label are omitted. Returns paginated prompt summaries. By default, only prompt metadata is returned, not full prompt content. Every result also includes `outline`, a flat list of markdown headings parsed from the prompt — use it as a lightweight table of contents, and pair with `content=none` to keep responses small.",+ "description": "List all LLM prompts stored for the current team. Optionally filter by name. Pass `label` (e.g. 'production') to get each prompt at the version that label currently points to; prompts without that label are omitted. Returns paginated prompt summaries. By default, only prompt metadata is returned, not full prompt content. Every result also includes `outline`, a flat list of markdown headings parsed from the prompt — use it as a lightweight table of contents, and pair with `content=none` to keep responses small. With `label` and `content=full`, prompt content is returned with `@@@prompt:...@@@` references resolved and `resolved_references` listing the spliced versions; unlabeled listings return raw content with any reference tags intact. Reference resolution is rolling out gradually and returns raw tags when not enabled for the team.","category": "AI observability","feature": "llm_analytics","summary": "List prompts",@@ -7303,7 +7303,7 @@}},"llma-prompt-update": {- "description": "Publish a new version of an existing LLM prompt by name. Name is immutable after creation.\nYou can either provide the full prompt content via 'prompt', or use 'edits' for incremental\nfind/replace updates. Each edit must have 'old' (text to find, must match exactly once) and\n'new' (replacement text). Edits are applied sequentially. Only one of 'prompt' or 'edits'\nmay be provided. 'base_version' is required — call llma-prompt-get first and pass its current\nversion number as 'base_version'; a stale base_version fails with a 409 conflict. Pass\n'version_description' with a short note on what changed and why — it is shown in the prompt's\nversion history.\nPass 'config' (a JSON object) to set model parameters or agent configuration on the new version.\nIf 'config' is omitted the current version's config is carried forward; pass null to clear it.\nA config-only publish (no 'prompt' or 'edits') keeps the prompt content unchanged.",+ "description": "Publish a new version of an existing LLM prompt by name. Name is immutable after creation.\nYou can either provide the full prompt content via 'prompt', or use 'edits' for incremental\nfind/replace updates. Each edit must have 'old' (text to find, must match exactly once) and\n'new' (replacement text). Edits are applied sequentially. Only one of 'prompt' or 'edits'\nmay be provided. 'base_version' is required — call llma-prompt-get first and pass its current\nversion number as 'base_version'; a stale base_version fails with a 409 conflict. Pass\n'version_description' with a short note on what changed and why — it is shown in the prompt's\nversion history.\nPass 'config' (a JSON object) to set model parameters or agent configuration on the new version.\nIf 'config' is omitted the current version's config is carried forward; pass null to clear it.\nA config-only publish (no 'prompt' or 'edits') keeps the prompt content unchanged.\nIf the prompt contains `@@@prompt:...@@@` references, fetch it with `resolve=false` first and edit\nthat raw text: the default llma-prompt-get response inlines the referenced prompts, so republishing\nit replaces the references with flattened copies that stop following label moves. 'edits' written\nagainst resolved content also fail to match, because the stored content keeps the tags.","category": "AI observability","feature": "llm_analytics","summary": "Update prompt",diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.jsonindex 08b91823c277..acd5f2a4e3b6 100644--- a/services/mcp/schema/tool-definitions-all.json+++ b/services/mcp/schema/tool-definitions-all.json@@ -7486,7 +7486,7 @@}},"llma-prompt-get": {- "description": "Get a specific LLM prompt by name. Requires `prompt_name`, which takes either the prompt's exact name or\nthe `id` UUID from any llma-prompt-list or llma-prompt-get response. Call llma-prompt-list to discover\nvalid names; a guessed name that matches nothing returns a 404.\nAn id identifies the prompt, not the version it came from, so passing a specific version's id still\nreturns the latest version. Pass `version` or `label` to pin one.\nUses the cached endpoint for fast retrieval.\nPass `label` (e.g. 'production') to fetch the version that label currently points to, or `version` for an\nexact version number — not both. With neither, the latest version is returned.\nThe response always includes `outline`, a flat list of markdown headings parsed from the prompt — useful\nas a lightweight table of contents. Pass `content=none` to get the outline without the prompt payload,\nor `content=preview` for a short `prompt_preview` snippet instead of the full prompt.\nWith full content the response also includes `config`, the JSON object of model parameters or agent\nconfiguration stored with the version (null when the version has none).",+ "description": "Get a specific LLM prompt by name. Requires `prompt_name`, which takes either the prompt's exact name or\nthe `id` UUID from any llma-prompt-list or llma-prompt-get response. Call llma-prompt-list to discover\nvalid names; a guessed name that matches nothing returns a 404.\nAn id identifies the prompt, not the version it came from, so passing a specific version's id still\nreturns the latest version. Pass `version` or `label` to pin one.\nUses the cached endpoint for fast retrieval.\nPass `label` (e.g. 'production') to fetch the version that label currently points to, or `version` for an\nexact version number — not both. With neither, the latest version is returned.\nThe response always includes `outline`, a flat list of markdown headings parsed from the prompt — useful\nas a lightweight table of contents. Pass `content=none` to get the outline without the prompt payload,\nor `content=preview` for a short `prompt_preview` snippet instead of the full prompt.\nWith full content the response also includes `config`, the JSON object of model parameters or agent\nconfiguration stored with the version (null when the version has none).\nPrompt content can contain `@@@prompt:...@@@` references to other prompts. By default the response is\nthe assembled content with each reference replaced by the referenced prompt's content, and\n`resolved_references` lists the exact versions spliced in. Pass `resolve=false` to get the raw text\nwith the tags intact — always do this before editing the prompt (see llma-prompt-update).\nReferences are rolling out gradually: when not enabled for the team, responses return the raw tags\nand no `resolved_references`, so treat content containing `@@@prompt:` as unresolved.","category": "AI observability","feature": "llm_analytics","summary": "Get prompt",@@ -7528,7 +7528,7 @@}},"llma-prompt-list": {- "description": "List all LLM prompts stored for the current team. Optionally filter by name. Pass `label` (e.g. 'production') to get each prompt at the version that label currently points to; prompts without that label are omitted. Returns paginated prompt summaries. By default, only prompt metadata is returned, not full prompt content. Every result also includes `outline`, a flat list of markdown headings parsed from the prompt — use it as a lightweight table of contents, and pair with `content=none` to keep responses small.",+ "description": "List all LLM prompts stored for the current team. Optionally filter by name. Pass `label` (e.g. 'production') to get each prompt at the version that label currently points to; prompts without that label are omitted. Returns paginated prompt summaries. By default, only prompt metadata is returned, not full prompt content. Every result also includes `outline`, a flat list of markdown headings parsed from the prompt — use it as a lightweight table of contents, and pair with `content=none` to keep responses small. With `label` and `content=full`, prompt content is returned with `@@@prompt:...@@@` references resolved and `resolved_references` listing the spliced versions; unlabeled listings return raw content with any reference tags intact. Reference resolution is rolling out gradually and returns raw tags when not enabled for the team.","category": "AI observability","feature": "llm_analytics","summary": "List prompts",@@ -7542,7 +7542,7 @@}},"llma-prompt-update": {- "description": "Publish a new version of an existing LLM prompt by name. Name is immutable after creation.\nYou can either provide the full prompt content via 'prompt', or use 'edits' for incremental\nfind/replace updates. Each edit must have 'old' (text to find, must match exactly once) and\n'new' (replacement text). Edits are applied sequentially. Only one of 'prompt' or 'edits'\nmay be provided. 'base_version' is required — call llma-prompt-get first and pass its current\nversion number as 'base_version'; a stale base_version fails with a 409 conflict. Pass\n'version_description' with a short note on what changed and why — it is shown in the prompt's\nversion history.\nPass 'config' (a JSON object) to set model parameters or agent configuration on the new version.\nIf 'config' is omitted the current version's config is carried forward; pass null to clear it.\nA config-only publish (no 'prompt' or 'edits') keeps the prompt content unchanged.",+ "description": "Publish a new version of an existing LLM prompt by name. Name is immutable after creation.\nYou can either provide the full prompt content via 'prompt', or use 'edits' for incremental\nfind/replace updates. Each edit must have 'old' (text to find, must match exactly once) and\n'new' (replacement text). Edits are applied sequentially. Only one of 'prompt' or 'edits'\nmay be provided. 'base_version' is required — call llma-prompt-get first and pass its current\nversion number as 'base_version'; a stale base_version fails with a 409 conflict. Pass\n'version_description' with a short note on what changed and why — it is shown in the prompt's\nversion history.\nPass 'config' (a JSON object) to set model parameters or agent configuration on the new version.\nIf 'config' is omitted the current version's config is carried forward; pass null to clear it.\nA config-only publish (no 'prompt' or 'edits') keeps the prompt content unchanged.\nIf the prompt contains `@@@prompt:...@@@` references, fetch it with `resolve=false` first and edit\nthat raw text: the default llma-prompt-get response inlines the referenced prompts, so republishing\nit replaces the references with flattened copies that stop following label moves. 'edits' written\nagainst resolved content also fail to match, because the stored content keeps the tags.","category": "AI observability","feature": "llm_analytics","summary": "Update prompt",