> ## Documentation Index
> Fetch the complete documentation index at: https://docs.streamkap.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Test Run Agent

> Run an agent against a single sample record without deploying to Flink.

Synchronous, hard-capped at 15s wall-clock. Calls the LLM provider
directly + dispatches MCP and HTTP tools live; transform tools and
memory are intentionally not exercised (the Flink runtime owns
them). Per-tenant rate limit: shares the validate-llm bucket
(30 req/min/tenant) -> 429.

Provider failures (timeouts, schema errors, unsupported provider) land
as a structured ``error`` object on the envelope (HTTP still 200) so
the FE can render the partial timeline alongside the error context.
Only the input-token cap raises (422) - at that point we can't even
start the run.



## OpenAPI

````yaml /openapi/openapi.json post /agents/test-run
openapi: 3.1.0
info:
  title: Streamkap REST API
  description: >-
    The Streamkap REST API allows you to programmatically manage your CDC
    pipelines, sources, destinations, transforms, and more.


    Authenticate using a bearer token obtained from the [Access
    Token](/api-reference/auth/access-token) endpoint with your API client
    credentials.
  contact:
    name: Streamkap Support
    url: https://streamkap.com/
    email: support@streamkap.com
  license:
    name: Proprietary
  version: 2.0.0
servers:
  - url: https://api.streamkap.com
    description: Production
security: []
tags:
  - name: Agents
    description: Create, deploy, and manage Flink-based AI agents.
  - name: Agents Observability
    description: >-
      Read-only views over the MCP audit log: agent rollup, sessions, spans,
      histograms, external-agent verify.
  - name: Alerts
    description: Manage alert subscribers, preferences, and notification credentials.
  - name: Authentication
    description: Obtain and refresh access tokens, manage client credentials and roles.
  - name: Billing
    description: Retrieve usage metrics, summaries, and export billing data.
  - name: Consumer Groups
    description: List, inspect, and reset Kafka consumer group offsets.
  - name: Dashboard
    description: Retrieve organisation-level statistics and overview data.
  - name: Destinations
    description: Create, configure, and manage data destinations and their lifecycle.
  - name: Kafka Access
    description: Manage Kafka users and their access permissions.
  - name: Logs
    description: Query and summarise system logs.
  - name: Pipelines
    description: Create, configure, and manage CDC pipelines and their lifecycle.
  - name: Project Keys
    description: Manage project keys that bundle API credentials and optional Kafka access.
  - name: Schema Registry
    description: Browse schema subjects, versions, and retrieve schema definitions.
  - name: Services
    description: View and switch service metadata.
  - name: Sources
    description: >-
      Create, configure, and manage data sources, snapshots, and their
      lifecycle.
  - name: Tags
    description: Create, update, and manage resource tags for organisation.
  - name: Topics
    description: Browse topic details, statistics, configurations, metrics, and messages.
  - name: Transforms
    description: >-
      Create, deploy, and manage data transforms, unit tests, and implementation
      details.
paths:
  /agents/test-run:
    post:
      tags:
        - Agents
      summary: Test Run Agent
      description: |-
        Run an agent against a single sample record without deploying to Flink.

        Synchronous, hard-capped at 15s wall-clock. Calls the LLM provider
        directly + dispatches MCP and HTTP tools live; transform tools and
        memory are intentionally not exercised (the Flink runtime owns
        them). Per-tenant rate limit: shares the validate-llm bucket
        (30 req/min/tenant) -> 429.

        Provider failures (timeouts, schema errors, unsupported provider) land
        as a structured ``error`` object on the envelope (HTTP still 200) so
        the FE can render the partial timeline alongside the error context.
        Only the input-token cap raises (422) - at that point we can't even
        start the run.
      operationId: testRunAgentOnSampleRecord
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestRunRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestRunResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - FronteggHTTPAuthentication: []
components:
  schemas:
    TestRunRequest:
      properties:
        config:
          $ref: '#/components/schemas/CreateAgentConfigRequest'
          description: Full agent config under test
        sampleRecord:
          additionalProperties: true
          type: object
          title: Samplerecord
          description: One Kafka-shaped record to feed the agent
        agentId:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Agentid
          description: >-
            Resolves an empty / masked ``apiKey`` against the stored agent's
            encrypted blob. Post-cutover the wizard sends ``apiKey: ''`` for
            every existing-agent test-run; this lets the BE swap in the stored
            key for legacy inline-key agents that were saved before the
            Connection cutover (no ``llmConnectionId`` to resolve via).
        savedConnectionId:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Savedconnectionid
          description: Mirror of the ValidateLlmRequest.savedConnectionId path.
        skipTools:
          type: boolean
          title: Skiptools
          description: >-
            When true, every MCP / HTTP tool dispatch returns a canned {skipped:
            true} payload to the LLM. Use to iterate on prompt shape without
            burning real tool calls.
          default: false
      additionalProperties: false
      type: object
      required:
        - config
        - sampleRecord
      title: TestRunRequest
      description: |-
        Request body for ``POST /agents/test-run``.

        Carries a full agent config + a sample record. The BE runs the
        record through the agent (LLM + tools) without touching Flink and
        returns the timeline so the FE can show what happened.
    TestRunResponse:
      properties:
        steps:
          items:
            $ref: '#/components/schemas/TestRunStep'
          type: array
          title: Steps
        finalOutput:
          title: Finaloutput
        stoppedReason:
          type: string
          enum:
            - completed
            - max_iterations
            - error
            - timeout
          title: Stoppedreason
        iterationsUsed:
          type: integer
          title: Iterationsused
        tokensIn:
          type: integer
          title: Tokensin
        tokensOut:
          type: integer
          title: Tokensout
        durationMs:
          type: integer
          title: Durationms
        approximations:
          items:
            type: string
          type: array
          title: Approximations
          description: >-
            Free-form list of caveats, e.g. 'memory_excluded',
            'transforms_skipped'.
        suggestions:
          items:
            $ref: '#/components/schemas/TestRunSuggestion'
          type: array
          title: Suggestions
          description: >-
            Deterministic hints (max 4) computed from the agent config + run
            result. Empty when the run produced a useful structured output. Each
            suggestion has a stable ``kind`` the FE can map to icon / copy.
        warnings:
          items:
            $ref: '#/components/schemas/TestRunWarning'
          type: array
          title: Warnings
          description: >-
            Static config-vs-record checks (e.g. memory keyField missing on the
            sample) that the Flink runtime would silently swallow at deploy.
            Empty when nothing is amiss.
        outputSchemaCheck:
          anyOf:
            - $ref: '#/components/schemas/TestRunSchemaCheck'
            - type: 'null'
          description: >-
            Field-level diff between the declared ``output.schema`` and the
            LLM's ``finalOutput``. Null when no schema was declared OR the run
            errored / produced a non-structured (text envelope) result.
            ``ok=true`` means every declared field is present with a compatible
            type.
        systemPrompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Systemprompt
          description: >-
            Composed system prompt the LLM actually received - base template +
            auto-injected schema fields + tool descriptions +
            customInstructions. Identical to what Flink sends at deploy time
            (built by the same ``build_system_prompt``). Null when the run
            errored before reaching the LLM (e.g. ``llm_resolution_error``).
        userMessage:
          anyOf:
            - type: string
            - type: 'null'
          title: Usermessage
          description: >-
            First user message dispatched to the LLM, after the ``prompts.user``
            template wraps the (input-fields-filtered) sample record. Lets the
            test pane show the exact pair of strings the LLM saw on iteration 1.
            Null when the run errored before message construction.
        error:
          anyOf:
            - $ref: '#/components/schemas/TestRunError'
            - type: 'null'
      additionalProperties: false
      type: object
      required:
        - steps
        - stoppedReason
        - iterationsUsed
        - tokensIn
        - tokensOut
        - durationMs
      title: TestRunResponse
      description: Response body for ``POST /agents/test-run``.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CreateAgentConfigRequest:
      properties:
        name:
          type: string
          maxLength: 200
          minLength: 1
          title: Name
          description: Agent display name
        description:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Description
          description: Human-readable context for the agent
        enabled:
          type: boolean
          title: Enabled
          description: >-
            Kill switch. When false, the Flink runtime accepts the deploy but
            stops emitting output — used by support to disable a runaway tenant
            agent without a full cancel/redeploy.
          default: true
        agentType:
          $ref: '#/components/schemas/AgentTypeEnum'
          description: >-
            Agent type — derived from the tool list post-validation;
            client-supplied value is overwritten
          default: workflow
        input:
          $ref: '#/components/schemas/AgentInputConfig'
        output:
          $ref: '#/components/schemas/AgentOutputConfig'
        llm:
          $ref: '#/components/schemas/AgentLlmConfig'
        prompts:
          $ref: '#/components/schemas/AgentPromptConfig'
        mcpServer:
          anyOf:
            - $ref: '#/components/schemas/AgentMcpServerConfig'
            - type: 'null'
          description: Shared MCP server config for all MCP tools
        tools:
          items:
            $ref: '#/components/schemas/AgentToolConfig'
          type: array
          title: Tools
          description: Agent tools (MCP, HTTP, transform)
        memory:
          anyOf:
            - $ref: '#/components/schemas/AgentMemoryConfig'
            - type: 'null'
          description: Memory config (short-term + long-term)
        knowledgeBases:
          items:
            $ref: '#/components/schemas/AgentKnowledgeBaseRef'
          type: array
          maxItems: 10
          title: Knowledgebases
          description: Knowledge bases this agent can query at runtime for RAG
        processing:
          $ref: '#/components/schemas/AgentProcessingConfig'
      additionalProperties: false
      type: object
      required:
        - name
        - input
        - output
        - llm
        - prompts
      title: CreateAgentConfigRequest
      description: Request body for POST /agents/config - create a config-based agent.
    TestRunStep:
      properties:
        kind:
          type: string
          enum:
            - llm
            - tool
          title: Kind
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
        tokensIn:
          anyOf:
            - type: integer
            - type: 'null'
          title: Tokensin
        tokensOut:
          anyOf:
            - type: integer
            - type: 'null'
          title: Tokensout
        stopReason:
          anyOf:
            - type: string
            - type: 'null'
          title: Stopreason
        text:
          anyOf:
            - type: string
            - type: 'null'
          title: Text
        toolCalls:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Toolcalls
        toolName:
          anyOf:
            - type: string
            - type: 'null'
          title: Toolname
        toolType:
          anyOf:
            - type: string
            - type: 'null'
          title: Tooltype
        request:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Request
        result:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Result
        skipped:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Skipped
        skippedReason:
          anyOf:
            - type: string
            - type: 'null'
          title: Skippedreason
        durationMs:
          anyOf:
            - type: integer
            - type: 'null'
          title: Durationms
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
      additionalProperties: false
      type: object
      required:
        - kind
      title: TestRunStep
      description: One row in the test-run timeline. Either an LLM call or a tool dispatch.
    TestRunSuggestion:
      properties:
        kind:
          type: string
          enum:
            - missing_output_schema
            - tools_not_invoked
            - near_empty_response
            - skip_instruction_may_apply
            - max_tokens_truncated
          title: Kind
        message:
          type: string
          title: Message
      additionalProperties: false
      type: object
      required:
        - kind
        - message
      title: TestRunSuggestion
      description: |-
        A deterministic, config-derived hint for improving a test-run result.

        Surfaced when a run completes successfully but the output is empty,
        near-empty, or otherwise unhelpful AND the cause is reliably
        identifiable from the agent config alone (no LLM-grade judgment).
        The FE renders these as a "Suggestions" panel under the result.

        ``kind`` is a stable enum the FE can map to icon / link copy. The
        ``message`` is a default rendering for clients that don't know the
        kind. Adding new kinds is non-breaking - the FE falls back to the
        message string for any unknown ``kind``.
    TestRunWarning:
      properties:
        kind:
          type: string
          enum:
            - memory_key_field_missing
            - input_fields_not_in_record
            - max_tokens_clamped
          title: Kind
        message:
          type: string
          title: Message
      additionalProperties: false
      type: object
      required:
        - kind
        - message
      title: TestRunWarning
      description: |-
        Static, pre-flight warning surfaced before / alongside the run.

        Distinct from ``error`` (which represents a run failure) and from
        ``suggestions`` (post-hoc empty-output hints). Warnings are
        deterministic config-vs-record checks (e.g. memory keyField missing)
        that the Flink runtime would silently swallow at deploy time.
    TestRunSchemaCheck:
      properties:
        ok:
          type: boolean
          title: Ok
        missing:
          items:
            type: string
          type: array
          title: Missing
          description: Fields declared in schema but absent from finalOutput
        extra:
          items:
            type: string
          type: array
          title: Extra
          description: Fields present in finalOutput but not declared
        typeMismatches:
          items:
            $ref: '#/components/schemas/TestRunSchemaTypeMismatch'
          type: array
          title: Typemismatches
          description: Fields whose value types diverge from the declared schema
      additionalProperties: false
      type: object
      required:
        - ok
      title: TestRunSchemaCheck
      description: >-
        Diff between the declared ``output.schema`` and the LLM's
        ``finalOutput``.


        Computed only when (a) the agent declared a schema and (b) the run

        produced a structured (non-text-envelope) final output. The Flink

        runtime DLQs records that fail this check at deploy time; surfacing

        the same comparison in test mode closes the audit's "silent

        output-schema bypass" gap.
    TestRunError:
      properties:
        kind:
          type: string
          title: Kind
          description: >-
            One of: llm_resolution_error, llm_provider_error, timeout,
            unsupported_provider, http_connection_resolution_error, …
        message:
          type: string
          title: Message
      additionalProperties: false
      type: object
      required:
        - kind
        - message
      title: TestRunError
      description: Structured error envelope on a failed test-run.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    AgentTypeEnum:
      type: string
      enum:
        - workflow
        - react
      title: AgentTypeEnum
    AgentInputConfig:
      properties:
        topicPattern:
          type: string
          maxLength: 1024
          minLength: 1
          title: Topicpattern
          description: Regex pattern for input topics, e.g. '^(orders)$'
        inputSerialization:
          $ref: '#/components/schemas/AgentSerializationEnum'
          description: Input deserialization format
          default: JsonConfluent
        fields:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Fields
          description: Column-level filter - only these fields sent to LLM
        createTableSQL:
          anyOf:
            - type: string
              maxLength: 4000
            - type: 'null'
          title: Createtablesql
          description: Flink SQL CREATE TABLE (required if filterSQL is set)
        filterSQL:
          anyOf:
            - type: string
              maxLength: 4000
            - type: 'null'
          title: Filtersql
          description: WHERE clause predicate for row-level filtering
      additionalProperties: false
      type: object
      required:
        - topicPattern
      title: AgentInputConfig
      description: Input configuration for the agent.
    AgentOutputConfig:
      properties:
        topic:
          type: string
          maxLength: 249
          minLength: 1
          title: Topic
          description: Fixed output topic name
        deadLetterTopic:
          anyOf:
            - type: string
              maxLength: 249
            - type: 'null'
          title: Deadlettertopic
          description: DLQ topic name
        outputSerialization:
          $ref: '#/components/schemas/AgentSerializationEnum'
          description: Output serialization format
          default: JsonConfluent
        schema:
          additionalProperties:
            $ref: '#/components/schemas/AgentOutputSchemaTypeEnum'
          type: object
          title: Schema
          description: 'Output schema: {field_name: TYPE_STRING}'
      additionalProperties: false
      type: object
      required:
        - topic
      title: AgentOutputConfig
      description: Output configuration for the agent.
    AgentLlmConfig:
      properties:
        provider:
          $ref: '#/components/schemas/AgentLlmProviderEnum'
          description: LLM provider
        model:
          type: string
          minLength: 1
          title: Model
          description: Model name, e.g. claude-sonnet-4-20250514
        apiKey:
          type: string
          maxLength: 512
          title: Apikey
          description: >-
            API key - use '${SECRET:ENV_VAR_NAME}' for env var resolution. Empty
            when llmConnectionId is set.
          default: ''
        llmConnectionId:
          anyOf:
            - type: string
              maxLength: 100
            - type: 'null'
          title: Llmconnectionid
          description: >-
            Tenant-scoped reference to
            ``agent_connections.llmConnections[].id``. When set with an empty
            ``apiKey``, the BE resolves the real key server-side at deploy and
            at test-run.
        baseUrl:
          anyOf:
            - type: string
            - type: 'null'
          title: Baseurl
          description: Base URL for OpenAI-compatible proxies
        temperature:
          anyOf:
            - type: number
              maximum: 2
              minimum: 0
            - type: 'null'
          title: Temperature
          description: Sampling temperature (null = matrix-skipped)
        maxTokens:
          anyOf:
            - type: integer
              maximum: 100000
              minimum: 1
            - type: 'null'
          title: Maxtokens
          description: Max output tokens (null = matrix-skipped)
        timeout:
          anyOf:
            - type: integer
              maximum: 600
              minimum: 1
            - type: 'null'
          title: Timeout
          description: Request timeout in seconds (null = matrix-skipped)
        reasoningEffort:
          anyOf:
            - type: string
              enum:
                - none
                - minimal
                - low
                - medium
                - high
                - xhigh
            - type: 'null'
          title: Reasoningeffort
          description: >-
            OpenAI / GPT-5 reasoning effort. The accepted set is per-model: the
            matrix in app/utils/llm_capabilities.py rejects values not in
            caps.reasoning_effort_values for the chosen provider+model.
        thinkingBudgetTokens:
          anyOf:
            - type: integer
              maximum: 64000
              minimum: 0
            - type: 'null'
          title: Thinkingbudgettokens
          description: >-
            Anthropic Claude 4 extended-thinking budget (tokens). Non-null
            enables thinking.
        ollamaThink:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Ollamathink
          description: Ollama 'think' toggle for reasoning models
        maxRetries:
          anyOf:
            - type: integer
              maximum: 20
              minimum: 0
            - type: 'null'
          title: Maxretries
          description: >-
            Universal — max retry attempts on LLM call. Accepted by every
            provider.
        region:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Region
          description: >-
            Bedrock: AWS region (e.g. us-east-1). Ignored for non-bedrock
            providers.
        strict:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Strict
          description: 'openai-responses: enable JSON-schema strict mode.'
        store:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Store
          description: 'openai-responses: server-side response storage flag.'
        instructions:
          anyOf:
            - type: string
              maxLength: 8192
            - type: 'null'
          title: Instructions
          description: >-
            openai-responses: system-level instructions passed as a top-level
            Responses param.
        additionalKwargs:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Additionalkwargs
          description: >-
            openai-responses / azure-openai: free-form extra request params
            forwarded verbatim by the runtime.
        apiVersion:
          anyOf:
            - type: string
              maxLength: 32
            - type: 'null'
          title: Apiversion
          description: >-
            azure-openai: Azure OpenAI API version (e.g. '2024-02-01'). Required
            for azure-openai.
        azureEndpoint:
          anyOf:
            - type: string
              maxLength: 512
            - type: 'null'
          title: Azureendpoint
          description: >-
            azure-openai: Azure resource endpoint (e.g.
            https://<resource>.openai.azure.com). Required.
        azureUrlPathMode:
          anyOf:
            - type: string
              enum:
                - AUTO
                - LEGACY
                - UNIFIED
            - type: 'null'
          title: Azureurlpathmode
          description: >-
            azure-openai: URL path resolution — AUTO / LEGACY / UNIFIED.
            Optional.
      additionalProperties: false
      type: object
      required:
        - provider
        - model
      title: AgentLlmConfig
      description: |-
        Inline LLM configuration embedded on the agent.

        Carries provider, credentials, model, and tuning controls as a single
        blob. The FE prefills the form from a saved :class:`AgentLlmConnection`
        (which now carries default model + tuning + reasoning controls) and
        the user can override per-agent before save; the resulting blob is
        stored verbatim and shipped to the Flink runtime at deploy.

        Two credential shapes (XOR, mirrors :class:`ValidateLlmRequest`):

        1. **Inline** - ``apiKey`` is filled directly. The BE KMS-encrypts it
           at save and decrypts it at deploy / test-run.
        2. **Linked** - ``llmConnectionId`` references a row in
           ``agent_connections.llmConnections`` and ``apiKey`` is left empty.
           The BE resolves the real key server-side at deploy and at test-run
           via :func:`agents_service.resolve_saved_llm_credentials`, so the
           browser never needs to hold (or re-paste) the stored plaintext when
           editing an existing agent.

        ``provider == ollama`` accepts an empty key without a link (the
        runtime is local and unauthenticated).
    AgentPromptConfig:
      properties:
        system:
          type: string
          maxLength: 8000
          title: System
          description: Assembled system prompt (auto-generated by backend)
          default: ''
        customInstructions:
          type: string
          maxLength: 8000
          title: Custominstructions
          description: User-provided instructions appended to the auto-generated prompt
          default: ''
        user:
          type: string
          maxLength: 2000
          title: User
          description: >-
            User prompt template - {input_json} is replaced with the input
            record
          default: <record>{input_json}</record>
      additionalProperties: false
      type: object
      title: AgentPromptConfig
      description: >-
        Prompt configuration for the agent.


        The final system prompt is auto-assembled by ``build_system_prompt()``
        from the

        agent type template + output schema + tool descriptions +
        custom_instructions.

        The ``system`` field stores the assembled result (set by the backend,
        not the user).
    AgentMcpServerConfig:
      properties:
        projectKeyId:
          anyOf:
            - type: string
              maxLength: 128
            - type: 'null'
          title: Projectkeyid
          description: >-
            ID of an agentic-enabled Project Key. When set, deploy-time resolves
            the Streamkap MCP serverUrl + auth header from the PK row. Mutually
            exclusive with serverUrl - one or the other, never both.
        serverUrl:
          anyOf:
            - type: string
              maxLength: 2048
              minLength: 1
            - type: 'null'
          title: Serverurl
          description: >-
            External MCP server URL. Required when projectKeyId is unset.
            Server-stamped from the PK row when projectKeyId is set.
        headers:
          additionalProperties:
            type: string
          type: object
          maxProperties: 32
          title: Headers
          description: Auth headers for MCP server
      additionalProperties: false
      type: object
      title: AgentMcpServerConfig
      description: >-
        Top-level MCP server config shared across all MCP tools.


        Two shapes (hard cutover):


        - **Streamkap MCP** (internal toolbelt): ``projectKeyId`` set,
        ``serverUrl``
          and ``headers`` resolved server-side at deploy time from the agentic-enabled
          Project Key. The legacy "saved Streamkap MCP card" path (match-by-serverUrl
          against ``agent_connections.mcpConnections[source==streamkap]``) is gone.
        - **External MCP**: ``serverUrl`` + ``headers`` set inline;
        ``projectKeyId``
          omitted. Headers are still composed at deploy time from the matching
          saved external connection (bearer / custom-header).
    AgentToolConfig:
      properties:
        name:
          type: string
          maxLength: 100
          minLength: 1
          title: Name
          description: Tool name (must be unique)
        type:
          $ref: '#/components/schemas/AgentToolTypeEnum'
          description: 'Tool type: http, transform, or mcp'
        description:
          type: string
          maxLength: 2000
          title: Description
          description: Tool description for the LLM
          default: ''
        config:
          additionalProperties: true
          type: object
          title: Config
          description: Type-specific configuration
        parameters:
          items:
            $ref: '#/components/schemas/AgentToolParameterConfig'
          type: array
          title: Parameters
          description: Tool parameters the LLM can provide
      additionalProperties: false
      type: object
      required:
        - name
        - type
      title: AgentToolConfig
      description: |-
        A single tool definition in the agent config.

        ``name`` and ``description`` are concatenated into the assembled system
        prompt by ``build_system_prompt()`` and shipped to Flink as part of the
        ``--agentConfig`` CLI argument. Length caps here keep the worst-case
        serialized agentConfig within the Flink CLI ~64KB single-arg budget even
        with many tools configured.
    AgentMemoryConfig:
      properties:
        keyField:
          anyOf:
            - type: string
            - type: 'null'
          title: Keyfield
          description: >-
            Field to partition memory by (e.g. 'customer_id'). Default: topic
            key
        shortTerm:
          $ref: '#/components/schemas/AgentShortTermMemoryConfig'
          description: Short-term conversation memory
        longTerm:
          $ref: '#/components/schemas/AgentLongTermMemoryConfig'
          description: Long-term vector store memory
      additionalProperties: false
      type: object
      title: AgentMemoryConfig
      description: Memory configuration for the agent.
    AgentKnowledgeBaseRef:
      properties:
        id:
          type: string
          maxLength: 64
          minLength: 1
          title: Id
          description: Knowledge base entity ID
        name:
          type: string
          maxLength: 200
          title: Name
          description: Display name (denormalized for UI)
          default: ''
      additionalProperties: false
      type: object
      required:
        - id
      title: AgentKnowledgeBaseRef
      description: >-
        Reference to a Knowledge Base that an agent can query at runtime for
        RAG.


        Stored on the agent config. At deploy time, the BE resolves each ref to
        the

        KB's vector store + embedding credentials and injects them into the
        Flink

        agentConfig JSON.
    AgentProcessingConfig:
      properties:
        parallelism:
          type: integer
          maximum: 128
          minimum: 1
          title: Parallelism
          description: Parallelism
          default: 1
        checkpointIntervalMin:
          type: integer
          maximum: 60
          minimum: 1
          title: Checkpointintervalmin
          description: Checkpoint interval in minutes
          default: 5
        maxIterations:
          type: integer
          maximum: 25
          minimum: 1
          title: Maxiterations
          description: Max tool-call iterations per record (react type only)
          default: 10
        maxTokensPerHour:
          type: integer
          minimum: 0
          title: Maxtokensperhour
          description: >-
            Per-TaskManager rolling-hour token budget. 0 = unlimited. When
            exceeded, records pass through with a `_budget_exceeded: true`
            marker.
          default: 0
      additionalProperties: false
      type: object
      title: AgentProcessingConfig
      description: Processing configuration for the agent.
    TestRunSchemaTypeMismatch:
      properties:
        field:
          type: string
          title: Field
        expected:
          type: string
          title: Expected
          description: Declared schema type, e.g. STRING / DOUBLE
        actual:
          type: string
          title: Actual
          description: Inferred type of the value the LLM returned
      additionalProperties: false
      type: object
      required:
        - field
        - expected
        - actual
      title: TestRunSchemaTypeMismatch
      description: >-
        One field-level mismatch between declared output schema and the LLM's
        response.
    AgentSerializationEnum:
      type: string
      enum:
        - JsonConfluent
        - AvroConfluent
      title: AgentSerializationEnum
    AgentOutputSchemaTypeEnum:
      type: string
      enum:
        - STRING
        - DOUBLE
        - INT32
        - INT64
        - BOOLEAN
      title: AgentOutputSchemaTypeEnum
    AgentLlmProviderEnum:
      type: string
      enum:
        - anthropic
        - openai
        - openai-responses
        - ollama
        - azure
        - azure-openai
        - bedrock
        - qwen
        - openai-compatible
      title: AgentLlmProviderEnum
      description: >-
        Unified LLM provider enum.


        A single ``AgentLlmConnection`` row carries one provider and a set of

        capabilities (chat / embedding). ``PROVIDER_CAPABILITIES`` below pins

        which capabilities each provider can serve — picked by the FE
        Connections

        drawer and re-validated server-side on every write.
    AgentToolTypeEnum:
      type: string
      enum:
        - http
        - transform
        - mcp
      title: AgentToolTypeEnum
    AgentToolParameterConfig:
      properties:
        name:
          type: string
          maxLength: 100
          minLength: 1
          title: Name
          description: Parameter name
        type:
          type: string
          maxLength: 50
          title: Type
          description: Parameter type (string, number, boolean)
          default: string
        description:
          type: string
          maxLength: 2000
          title: Description
          description: Parameter description for the LLM
          default: ''
      additionalProperties: false
      type: object
      required:
        - name
      title: AgentToolParameterConfig
      description: A single parameter for a tool.
    AgentShortTermMemoryConfig:
      properties:
        enabled:
          type: boolean
          title: Enabled
          description: Enable short-term memory
          default: false
        ttlMs:
          type: integer
          minimum: 0
          title: Ttlms
          description: 'Time-to-live in milliseconds (default: 1 hour)'
          default: 3600000
        maxEntries:
          type: integer
          maximum: 100
          minimum: 1
          title: Maxentries
          description: Max conversation entries per key
          default: 20
      additionalProperties: false
      type: object
      title: AgentShortTermMemoryConfig
      description: Short-term (conversation) memory config.
    AgentLongTermMemoryConfig:
      properties:
        enabled:
          type: boolean
          title: Enabled
          description: Enable long-term memory
          default: false
        vectorStoreConnectionId:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Vectorstoreconnectionid
          description: >-
            Reference to a saved AgentVectorStoreConnection. Resolved at deploy
            time.
        namespace:
          anyOf:
            - type: string
              maxLength: 200
            - type: 'null'
          title: Namespace
          description: >-
            Per-agent namespace override (falls back to connection's
            defaultNamespace)
        destinationId:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Destinationid
          description: >-
            (Legacy) ObjectId of a Pinecone destination connector. Prefer
            vectorStoreConnectionId.
      additionalProperties: false
      type: object
      title: AgentLongTermMemoryConfig
      description: >-
        Long-term (vector store) memory config.


        References a saved ``AgentVectorStoreConnection`` by id. At deploy time

        the resolver reads the connection's ``apiKey`` + ``endpoint`` and
        composes

        the inline ``vectorStore`` block the Java runtime expects.


        Legacy agents may still carry ``destinationId`` (a Pinecone destination

        connector from the old flow). The deploy resolver handles both: if

        ``vectorStoreConnectionId`` is set it wins; otherwise it falls back to

        the legacy ``destinationId`` path. New agents created through the FE

        always use ``vectorStoreConnectionId``.
  securitySchemes:
    FronteggHTTPAuthentication:
      type: http
      scheme: bearer

````