: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
chore(aio): clarify required params in AI observability MCP tool descriptions (#73584)
Radu Raiceae1da810edd75
diff --git a/products/ai_observability/mcp/tools.yaml b/products/ai_observability/mcp/tools.yamlindex 0238cf4bebf5..44598d3fe7a0 100644--- a/products/ai_observability/mcp/tools.yaml+++ b/products/ai_observability/mcp/tools.yaml@@ -214,8 +214,8 @@ tools:Create an evaluation. 'llm_judge': set evaluation_config.prompt and model_configuration with provider andmodel; provider_key_id may be null when no key is pinned. 'hog': evaluation_config.source (Hog returning aboolean). 'sentiment': output_type='sentiment', omit model_configuration, optional- evaluation_config.source='user_messages'. When enabled, runs on new $ai_generation events; results are- '$ai_evaluation' events.+ evaluation_config.source='user_messages'. Pass `enabled` as a boolean (true to start scoring new+ $ai_generation events immediately, false to create it paused). Results are '$ai_evaluation' events.llma-evaluation-delete:operation: evaluations_destroyenabled: true@@ -241,8 +241,9 @@ tools:idempotent: truetitle: Get evaluationdescription: >- Get a specific AI observability evaluation by its UUID. Returns the full evaluation configuration including- type, config, output type, enabled status, and model configuration.+ Get a specific AI observability evaluation by its UUID. Requires the evaluation `id` (UUID) as a parameter —+ if you don't have it, call llma-evaluation-list first to look it up by name. Returns the full evaluation+ configuration including type, config, output type, enabled status, and model configuration.llma-evaluation-judge-models:operation: llm_analytics_models_retrieveenabled: true@@ -254,10 +255,11 @@ tools:idempotent: truetitle: List supported llm_judge modelsdescription: >- List provider+model combinations supported for llm_judge. Pass `provider` (openai, anthropic, gemini,- openrouter, fireworks, azure_openai, together_ai, minimax, zeabur); optional `key_id` scopes to a key's- reachable deployments (mainly azure_openai). Call before creating an llm_judge eval to pick a valid combo —- prefer a provider the team already has a key for (see llma-provider-key-list).+ List provider+model combinations supported for llm_judge. `provider` is required and must be exactly one of+ these lowercase values: openai, anthropic, gemini, openrouter, fireworks, azure_openai, together_ai,+ minimax, zeabur. Optional `key_id` scopes to a key's reachable deployments (mainly azure_openai). Call+ before creating an llm_judge eval to pick a valid combo — prefer a provider the team already has a key for+ (see llma-provider-key-list).llma-evaluation-list:operation: evaluations_listenabled: true@@ -449,8 +451,9 @@ tools:idempotent: truetitle: Update evaluationdescription: >- Partially update an AI observability evaluation. Toggle enabled, change its type or evaluation config, or- change the model for an llm_judge. When switching to llm_judge, include model_configuration with provider+ Partially update an AI observability evaluation. Requires the evaluation `id` (UUID) — if you don't have it,+ call llma-evaluation-list first to look it up by name. Toggle enabled, change its type or evaluation config,+ or change the model for an llm_judge. When switching to llm_judge, include model_configuration with providerand model. When an llm_judge remains an llm_judge, omit model_configuration to keep its current model orprovide both fields to replace it; null is rejected for configured judges. When switching an llm_judge tohog or sentiment, set model_configuration to null. Legacy llm_judge evaluations without a model remain@@ -519,7 +522,9 @@ tools:idempotent: truetitle: Get promptdescription: |- Get a specific LLM prompt by name. Uses the cached endpoint for fast retrieval.+ Get a specific LLM prompt by name. Requires `prompt_name`, the prompt's exact name — call+ llma-prompt-list to discover valid names; an unknown or guessed name returns a 404.+ Uses the cached endpoint for fast retrieval.Pass `label` (e.g. 'production') to fetch the version that label currently points to, or `version` for anexact version number — not both. With neither, the latest version is returned.The response always includes `outline`, a flat list of markdown headings parsed from the prompt — useful@@ -592,13 +597,18 @@ tools:You can either provide the full prompt content via 'prompt', or use 'edits' for incrementalfind/replace updates. Each edit must have 'old' (text to find, must match exactly once) and'new' (replacement text). Edits are applied sequentially. Only one of 'prompt' or 'edits'- may be provided. Pass 'version_description' with a short note on what changed and why —- it is shown in the prompt's version history.+ may be provided. 'base_version' is required — call llma-prompt-get first and pass its current+ version number as 'base_version'; a stale base_version fails with a 409 conflict. Pass+ 'version_description' with a short note on what changed and why — it is shown in the prompt's+ version history.include_params:- prompt- edits- base_version- version_description+ param_overrides:+ base_version:+ required: truellma-provider-key-create:operation: llm_analytics_provider_keys_createenabled: falsediff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.jsonindex 8a69255cf61b..6810bb13ad09 100644--- a/services/mcp/schema/generated-tool-definitions.json+++ b/services/mcp/schema/generated-tool-definitions.json@@ -5454,7 +5454,7 @@}},"llma-evaluation-create": {- "description": "Create an evaluation. 'llm_judge': set evaluation_config.prompt and model_configuration with provider and model; provider_key_id may be null when no key is pinned. 'hog': evaluation_config.source (Hog returning a boolean). 'sentiment': output_type='sentiment', omit model_configuration, optional evaluation_config.source='user_messages'. When enabled, runs on new $ai_generation events; results are '$ai_evaluation' events.",+ "description": "Create an evaluation. 'llm_judge': set evaluation_config.prompt and model_configuration with provider and model; provider_key_id may be null when no key is pinned. 'hog': evaluation_config.source (Hog returning a boolean). 'sentiment': output_type='sentiment', omit model_configuration, optional evaluation_config.source='user_messages'. Pass `enabled` as a boolean (true to start scoring new $ai_generation events immediately, false to create it paused). Results are '$ai_evaluation' events.","category": "AI observability","feature": "llm_analytics","summary": "Create evaluation",@@ -5482,7 +5482,7 @@}},"llma-evaluation-get": {- "description": "Get a specific AI observability evaluation by its UUID. Returns the full evaluation configuration including type, config, output type, enabled status, and model configuration.",+ "description": "Get a specific AI observability evaluation by its UUID. Requires the evaluation `id` (UUID) as a parameter — if you don't have it, call llma-evaluation-list first to look it up by name. Returns the full evaluation configuration including type, config, output type, enabled status, and model configuration.","category": "AI observability","feature": "llm_analytics","summary": "Get evaluation",@@ -5496,7 +5496,7 @@}},"llma-evaluation-judge-models": {- "description": "List provider+model combinations supported for llm_judge. Pass `provider` (openai, anthropic, gemini, openrouter, fireworks, azure_openai, together_ai, minimax, zeabur); optional `key_id` scopes to a key's reachable deployments (mainly azure_openai). Call before creating an llm_judge eval to pick a valid combo — prefer a provider the team already has a key for (see llma-provider-key-list).",+ "description": "List provider+model combinations supported for llm_judge. `provider` is required and must be exactly one of these lowercase values: openai, anthropic, gemini, openrouter, fireworks, azure_openai, together_ai, minimax, zeabur. Optional `key_id` scopes to a key's reachable deployments (mainly azure_openai). Call before creating an llm_judge eval to pick a valid combo — prefer a provider the team already has a key for (see llma-provider-key-list).","category": "AI observability","feature": "llm_analytics","summary": "List supported llm_judge models",@@ -5651,7 +5651,7 @@}},"llma-evaluation-update": {- "description": "Partially update an AI observability evaluation. Toggle enabled, change its type or evaluation config, or change the model for an llm_judge. When switching to llm_judge, include model_configuration with provider and model. When an llm_judge remains an llm_judge, omit model_configuration to keep its current model or provide both fields to replace it; null is rejected for configured judges. When switching an llm_judge to hog or sentiment, set model_configuration to null. Legacy llm_judge evaluations without a model remain editable. provider_key_id may be null when no key is pinned.",+ "description": "Partially update an AI observability evaluation. Requires the evaluation `id` (UUID) — if you don't have it, call llma-evaluation-list first to look it up by name. Toggle enabled, change its type or evaluation config, or change the model for an llm_judge. When switching to llm_judge, include model_configuration with provider and model. When an llm_judge remains an llm_judge, omit model_configuration to keep its current model or provide both fields to replace it; null is rejected for configured judges. When switching an llm_judge to hog or sentiment, set model_configuration to null. Legacy llm_judge evaluations without a model remain editable. provider_key_id may be null when no key is pinned.","category": "AI observability","feature": "llm_analytics","summary": "Update evaluation",@@ -5707,7 +5707,7 @@}},"llma-prompt-get": {- "description": "Get a specific LLM prompt by name. Uses 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.",+ "description": "Get a specific LLM prompt by name. Requires `prompt_name`, the prompt's exact name — call\nllma-prompt-list to discover valid names; an unknown or guessed name returns a 404.\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.","category": "AI observability","feature": "llm_analytics","summary": "Get prompt",@@ -5763,7 +5763,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. Pass 'version_description' with a short note on what changed and why —\nit is shown in the prompt's version history.",+ "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.","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 6dde8ebd93cc..e656ea88b0d5 100644--- a/services/mcp/schema/tool-definitions-all.json+++ b/services/mcp/schema/tool-definitions-all.json@@ -5763,7 +5763,7 @@}},"llma-evaluation-create": {- "description": "Create an evaluation. 'llm_judge': set evaluation_config.prompt and model_configuration with provider and model; provider_key_id may be null when no key is pinned. 'hog': evaluation_config.source (Hog returning a boolean). 'sentiment': output_type='sentiment', omit model_configuration, optional evaluation_config.source='user_messages'. When enabled, runs on new $ai_generation events; results are '$ai_evaluation' events.",+ "description": "Create an evaluation. 'llm_judge': set evaluation_config.prompt and model_configuration with provider and model; provider_key_id may be null when no key is pinned. 'hog': evaluation_config.source (Hog returning a boolean). 'sentiment': output_type='sentiment', omit model_configuration, optional evaluation_config.source='user_messages'. Pass `enabled` as a boolean (true to start scoring new $ai_generation events immediately, false to create it paused). Results are '$ai_evaluation' events.","category": "AI observability","feature": "llm_analytics","summary": "Create evaluation",@@ -5791,7 +5791,7 @@}},"llma-evaluation-get": {- "description": "Get a specific AI observability evaluation by its UUID. Returns the full evaluation configuration including type, config, output type, enabled status, and model configuration.",+ "description": "Get a specific AI observability evaluation by its UUID. Requires the evaluation `id` (UUID) as a parameter — if you don't have it, call llma-evaluation-list first to look it up by name. Returns the full evaluation configuration including type, config, output type, enabled status, and model configuration.","category": "AI observability","feature": "llm_analytics","summary": "Get evaluation",@@ -5805,7 +5805,7 @@}},"llma-evaluation-judge-models": {- "description": "List provider+model combinations supported for llm_judge. Pass `provider` (openai, anthropic, gemini, openrouter, fireworks, azure_openai, together_ai, minimax, zeabur); optional `key_id` scopes to a key's reachable deployments (mainly azure_openai). Call before creating an llm_judge eval to pick a valid combo — prefer a provider the team already has a key for (see llma-provider-key-list).",+ "description": "List provider+model combinations supported for llm_judge. `provider` is required and must be exactly one of these lowercase values: openai, anthropic, gemini, openrouter, fireworks, azure_openai, together_ai, minimax, zeabur. Optional `key_id` scopes to a key's reachable deployments (mainly azure_openai). Call before creating an llm_judge eval to pick a valid combo — prefer a provider the team already has a key for (see llma-provider-key-list).","category": "AI observability","feature": "llm_analytics","summary": "List supported llm_judge models",@@ -5960,7 +5960,7 @@}},"llma-evaluation-update": {- "description": "Partially update an AI observability evaluation. Toggle enabled, change its type or evaluation config, or change the model for an llm_judge. When switching to llm_judge, include model_configuration with provider and model. When an llm_judge remains an llm_judge, omit model_configuration to keep its current model or provide both fields to replace it; null is rejected for configured judges. When switching an llm_judge to hog or sentiment, set model_configuration to null. Legacy llm_judge evaluations without a model remain editable. provider_key_id may be null when no key is pinned.",+ "description": "Partially update an AI observability evaluation. Requires the evaluation `id` (UUID) — if you don't have it, call llma-evaluation-list first to look it up by name. Toggle enabled, change its type or evaluation config, or change the model for an llm_judge. When switching to llm_judge, include model_configuration with provider and model. When an llm_judge remains an llm_judge, omit model_configuration to keep its current model or provide both fields to replace it; null is rejected for configured judges. When switching an llm_judge to hog or sentiment, set model_configuration to null. Legacy llm_judge evaluations without a model remain editable. provider_key_id may be null when no key is pinned.","category": "AI observability","feature": "llm_analytics","summary": "Update evaluation",@@ -6016,7 +6016,7 @@}},"llma-prompt-get": {- "description": "Get a specific LLM prompt by name. Uses 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.",+ "description": "Get a specific LLM prompt by name. Requires `prompt_name`, the prompt's exact name — call\nllma-prompt-list to discover valid names; an unknown or guessed name returns a 404.\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.","category": "AI observability","feature": "llm_analytics","summary": "Get prompt",@@ -6072,7 +6072,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. Pass 'version_description' with a short note on what changed and why —\nit is shown in the prompt's version history.",+ "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.","category": "AI observability","feature": "llm_analytics","summary": "Update prompt",diff --git a/services/mcp/src/tools/generated/ai_observability.ts b/services/mcp/src/tools/generated/ai_observability.tsindex baffa900e4ba..70495d330768 100644--- a/services/mcp/src/tools/generated/ai_observability.ts+++ b/services/mcp/src/tools/generated/ai_observability.ts@@ -875,9 +875,9 @@ const llmaPromptList = (): ToolBase<},})-const LlmaPromptUpdateSchema = LlmPromptsNamePartialUpdateParams.omit({ project_id: true }).extend(- LlmPromptsNamePartialUpdateBody.shape-)+const LlmaPromptUpdateSchema = LlmPromptsNamePartialUpdateParams.omit({ project_id: true })+ .extend(LlmPromptsNamePartialUpdateBody.shape)+ .extend({ base_version: LlmPromptsNamePartialUpdateBody.shape['base_version'].unwrap() })const llmaPromptUpdate = (): ToolBase<typeof LlmaPromptUpdateSchema, Schemas.LLMPrompt> => ({name: 'llma-prompt-update',diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-prompt-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-prompt-update.jsonindex 13257bd23f53..c9c8289ec7a2 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-prompt-update.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-prompt-update.json@@ -2,7 +2,6 @@"$schema": "https://json-schema.org/draft/2020-12/schema","properties": {"base_version": {- "description": "Latest version you are editing from. Used for optimistic concurrency checks.","minimum": 1,"type": "number"},@@ -37,6 +36,6 @@"type": "string"}},- "required": ["prompt_name"],+ "required": ["prompt_name", "base_version"],"type": "object"}diff --git a/services/mcp/tests/unit/prompts-generated.test.ts b/services/mcp/tests/unit/prompts-generated.test.tsindex 5832fdacae67..89a1dd5b2ab4 100644--- a/services/mcp/tests/unit/prompts-generated.test.ts+++ b/services/mcp/tests/unit/prompts-generated.test.ts@@ -44,6 +44,15 @@ describe('Generated llma-prompt-* tools', () => {expect(() => tool.schema.parse({ name: 'checkout_prompt', prompt: { text: 'v2' } })).toThrow()})+ it('requires base_version on the prompt-update schema (PATCH optionality stripped)', () => {+ const tool = getToolByName(GENERATED_TOOLS, 'llma-prompt-update')++ // The backend serializer requires base_version for optimistic concurrency, but the+ // PATCH endpoint marks it optional in OpenAPI — the schema must re-require it so the+ // agent can't silently omit it and hit a backend 400.+ expect(() => tool.schema.parse({ prompt_name: 'checkout_prompt', prompt: { text: 'v2' } })).toThrow()+ })+it('wires prompt-list to GET and preserves paginated output shape', async () => {const paginated = {count: 1,