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.

12.5 KB
Raw Blame
# MCP tool definitions. Tools are opt-in: an operation is exposed only when it has an entry here.
# List operations without an entry: pnpm --filter=@posthog/mcp run scaffold-yaml -- --candidates --product business_knowledge
# Add one: pnpm --filter=@posthog/mcp run scaffold-yaml -- --add <operationId> --product business_knowledge
# To keep an operation off on purpose, set enabled: false and give a disabled_reason.
category: Business knowledge
feature: business_knowledge
url_prefix: /business-knowledge
ui_apps: {}
tools:
    business-knowledge-document-window-retrieve:
        operation: business_knowledge_documents_window_list
        enabled: true
        scopes:
            - business_knowledge:read
        annotations:
            readOnly: true
            destructive: false
            idempotent: true
        title: Read business knowledge document context
        description: >
            Returns a window of content chunks from a business knowledge document, centered around a specific ordinal.
            Use after searching knowledge to get more surrounding context for a specific result.
        feature_flag: product-business-knowledge
    business-knowledge-documents-search:
        operation: business_knowledge_documents_search_list
        enabled: true
        scopes:
            - business_knowledge:read
        annotations:
            readOnly: true
            destructive: false
            idempotent: true
        title: Search business knowledge
        description: >
            Hybrid (semantic + full-text) search over the project's business knowledge base. Returns ranked chunks with
            document_id and ordinal — pass these to the document-window tool to drill down into surrounding context. Use
            for a question about the user's own company: its product, internal terms, policies, decisions, or internal
            docs. Do not use it to answer a question from project data, or for how PostHog works unless PostHog is the
            user's own company; use docs-search for PostHog. Set rerank=true for a listwise LLM rerank pass when
            top-result precision matters. Pass library_id to search one library, and pass that same id to repository
            search and file read. Omit library_id to search every ready source.
        feature_flag: product-business-knowledge
    business-knowledge-libraries-create:
        operation: business_knowledge_libraries_create
        enabled: true
        scopes:
            - business_knowledge:write
        annotations:
            readOnly: false
            destructive: false
            idempotent: false
        title: Create a business knowledge library
        description: >
            Create a library. It does not copy sources. Add sources with business-knowledge-sources-partial-update
            library_ids, then pass the library id to document search, repository search, and file read.
        feature_flag: product-business-knowledge
    business-knowledge-libraries-destroy:
        operation: business_knowledge_libraries_destroy
        enabled: true
        scopes:
            - business_knowledge:write
        annotations:
            readOnly: false
            destructive: true
            idempotent: true
        title: Delete a business knowledge library
        description: >
            Delete a library and its links. Sources, documents, chunks, and selected repositories stay. Search without a
            library id still sees them.
        feature_flag: product-business-knowledge
    business-knowledge-libraries-list:
        operation: business_knowledge_libraries_list
        enabled: true
        scopes:
            - business_knowledge:read
        annotations:
            readOnly: true
            destructive: false
            idempotent: true
        list: true
        title: List business knowledge libraries
        description: >
            List libraries in this project. A library limits document search, repository search, and file read to its
            members. Pass the same library id to all three. The default library is first. Omit a library id on those
            tools to search everything.
        feature_flag: product-business-knowledge
    business-knowledge-libraries-partial-update:
        operation: business_knowledge_libraries_partial_update
        enabled: true
        scopes:
            - business_knowledge:write
        annotations:
            readOnly: false
            destructive: false
            idempotent: true
        title: Update a business knowledge library
        description: >
            Rename a library, replace its sources, or replace this environment's repositories in it. Send only the
            fields to change. source_ids replaces every source. repos replaces repositories this environment allows and
            leaves repositories that only another environment allows.
        feature_flag: product-business-knowledge
    business-knowledge-libraries-retrieve:
        operation: business_knowledge_libraries_retrieve
        enabled: true
        scopes:
            - business_knowledge:read
        annotations:
            readOnly: true
            destructive: false
            idempotent: true
        title: Get a business knowledge library
        description: >
            Get one library by id, including how many sources it has and which selected repositories it includes for
            this environment.
        feature_flag: product-business-knowledge
    business-knowledge-repositories-file-retrieve:
        operation: business_knowledge_repositories_file_retrieve
        enabled: true
        scopes:
            - business_knowledge:read
        annotations:
            readOnly: true
            destructive: false
            idempotent: true
        title: Read a file from a selected repository
        description: >
            Read one file from a GitHub repository selected for business knowledge. The path must come from
            business-knowledge-repositories-search. Returns the file text and a permalink. Does not search file
            contents. Pass library_id to read a repository in that library, using the same id as document search and
            repository search. Omit library_id to read any selected repository.
        feature_flag: product-business-knowledge
    business-knowledge-repositories-search:
        operation: business_knowledge_repositories_search
        enabled: true
        scopes:
            - business_knowledge:read
        annotations:
            readOnly: true
            destructive: false
            idempotent: true
        title: Search selected repositories
        description: >
            Search file paths and README text in the GitHub repositories selected for business knowledge. Use it for the
            user's own code, and for company docs kept in a repository instead of in document search. Pass file names or
            identifiers, not a full sentence. Each repository in the response includes its GitHub description. When a
            description says the repository holds a handbook or docs, search that repository for those words and read
            the file. Does not search inside file contents and does not call GitHub code search. Pass library_id to
            search repositories in that library, using the same id as document search and file read. Omit library_id to
            search every selected repository.
        feature_flag: product-business-knowledge
    business-knowledge-sources-list:
        operation: business_knowledge_sources_list
        enabled: true
        scopes:
            - business_knowledge:read
        annotations:
            readOnly: true
            destructive: false
            idempotent: true
        enrich_url: '{id}'
        list: true
        title: List business knowledge sources
        description: >
            List all business knowledge sources in the project, with document/chunk counts, processing status, and
            refresh metadata.
        feature_flag: product-business-knowledge
        response:
            include:
                - id
                - name
                - source_type
                - status
                - error_message
                - document_count
                - chunk_count
                - source_url
                - has_unsafe_documents
                - always_include
                - refresh_interval
                - next_refresh_at
                - created_at
                - updated_at
                - library_ids
    business-knowledge-sources-partial-update:
        operation: business_knowledge_sources_partial_update
        enabled: true
        scopes:
            - business_knowledge:write
        annotations:
            readOnly: false
            destructive: false
            idempotent: true
        title: Update business knowledge source
        description: >
            Update an existing business knowledge source by ID. Change its name, replace the text content (text sources
            only — triggers a re-chunk), or toggle `always_include`. Set `always_include: true` to inject this source's
            content into every support reply as general guidance (tone, policies, company direction); set false to make
            it retrieval-only again. Pass library_ids to replace the libraries this source belongs to. An empty list
            removes it from every library. Omit library_ids to leave membership unchanged. Only the fields you pass are
            changed.
        feature_flag: product-business-knowledge
    business-knowledge-sources-retrieve:
        operation: business_knowledge_sources_retrieve
        enabled: true
        scopes:
            - business_knowledge:read
        annotations:
            readOnly: true
            destructive: false
            idempotent: true
        enrich_url: '{id}'
        title: Get business knowledge source
        description: >
            Get a single business knowledge source by ID, including processing status, document/chunk counts, and
            refresh metadata.
        feature_flag: product-business-knowledge
    business-knowledge-sources-text-create:
        operation: business_knowledge_sources_create
        enabled: true
        scopes:
            - business_knowledge:write
        annotations:
            readOnly: false
            destructive: false
            idempotent: false
        title: Create text business knowledge source
        description: >
            Save durable, reusable company knowledge as a searchable text source — the kind of reference material a team
            wants every future agent session to draw on. Good fits: product specs, internal docs, runbooks, policies,
            FAQs, glossaries, architecture/decision records, brand or style guides. Do NOT use this as a scratchpad for
            the current task or to dump transient material (raw web-search results, random articles, one-off snippets,
            chat logs) — only persist knowledge the user has asked to keep or that is clearly of lasting value to the
            whole team. Never store secrets or personal data. Provide a short descriptive name and the raw text (capped
            at 1 MB); it is chunked, embedded, and made searchable. Returns the created source with its processing
            status.
        feature_flag: product-business-knowledge
    business-knowledge-sources-url-create:
        operation: business_knowledge_sources_create
        enabled: true
        scopes:
            - business_knowledge:write
        annotations:
            readOnly: false
            destructive: false
            idempotent: false
        input_schema: BusinessKnowledgeUrlSourceCreateSchema
        title: Create URL business knowledge source
        description: >
            Index a web page as durable, reusable company knowledge that every future agent session can draw on. Use it
            for authoritative, lasting references the whole team benefits from — public product docs, API references,
            help-center articles, changelogs, status/policy pages. Do NOT index pages you happened to open while
            researching the current task, arbitrary search-result links, or pages the user didn't ask to keep — this
            store is curated team knowledge, not a browsing history. Provide a name and a public HTTP(S) URL; the page
            is fetched, parsed, chunked, and made searchable. Optionally set a refresh interval so the source is
            re-fetched automatically. Returns the created source with its processing status (initially "processing"
            while the URL is fetched in the background).
        feature_flag: product-business-knowledge