Skip to content

: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.

584 B
Raw Blame
/**
 * Hooks for the generated `experiment-get` tool. They add viewable URLs for the variant screenshots
 * and a `condition_id` to each condition of the linked flag.
 */
import { withConditionIds } from '@/tools/featureFlags/conditionIds'
import type { ToolHooks } from '@/tools/tool-hooks'

import { withVariantScreenshotUrls } from './variantDetails'

export default {
    afterResponse: (context, _params, result) =>
        withConditionIds(withVariantScreenshotUrls(result as { parameters?: unknown }, context.api.publicBaseUrl)),
} satisfies ToolHooks<Record<string, unknown>>