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

# Agent tool get kql table columns



## OpenAPI

````yaml /api-reference/openapi.json post /api/v2/workspaces/{workspaceId}/agent/tools/kql/tables/columns
openapi: 3.1.1
info:
  title: ContraForce API
  description: ContraForce platform API for security operations management.
  version: '2.0'
servers: []
security: []
tags:
  - name: Incidents
  - name: Gamebooks
  - name: Data sources
  - name: Service tickets
  - name: Investigation
  - name: agent-tools
  - name: Cross-workspace incidents
  - name: Cross-workspace gamebooks
  - name: Cross-workspace data sources
  - name: Webhooks
  - name: Service accounts
  - name: Users
  - name: Azure resources
paths:
  /api/v2/workspaces/{workspaceId}/agent/tools/kql/tables/columns:
    post:
      tags:
        - agent-tools
      summary: Agent tool get kql table columns
      operationId: v2-agent-tool-get-kql-table-columns
      parameters:
        - name: workspaceId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentToolKqlTableColumnsRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ApiResponseOfAgentToolKqlTableColumnsResult
        '400':
          description: Bad request — validation or parameter binding failed.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ApiProblemDetails'
        '401':
          description: Unauthorized — missing or invalid Bearer token.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ApiProblemDetails'
        '403':
          description: Forbidden — insufficient scope or workspace access.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ApiProblemDetails'
        '404':
          description: Not found — workspace or resource is missing.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ApiProblemDetails'
        '500':
          description: Internal server error.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ApiProblemDetails'
components:
  schemas:
    AgentToolKqlTableColumnsRequest:
      type: object
      properties:
        table_names:
          type:
            - 'null'
            - array
          items:
            type: string
          description: >-
            Table names to fetch column metadata for. Names from list-kql-tables
            work as-is. Unknown names are echoed back in `unknown_table_names`
            rather than silently dropped, so the agent can recover. Must contain
            at least one entry.
      description: >-
        Request DTO for the agent's get-KQL-table-columns tool. Pass the table
        names the

        agent wants column metadata for — the response includes per-table column
        lists and

        echoes back any names that didn't resolve to a real table.
    ApiResponseOfAgentToolKqlTableColumnsResult:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/AgentToolKqlTableColumnsResult'
        meta:
          $ref: '#/components/schemas/ResponseMeta'
      description: Standard v2 API response envelope for single-item responses.
    ApiProblemDetails:
      type: object
      properties:
        type:
          type:
            - 'null'
            - string
        title:
          type:
            - 'null'
            - string
        status:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          format: int32
        detail:
          type:
            - 'null'
            - string
        instance:
          type:
            - 'null'
            - string
        code:
          type:
            - 'null'
            - string
        requestId:
          type:
            - 'null'
            - string
        timestamp:
          type:
            - 'null'
            - string
        target:
          type:
            - 'null'
            - string
        errors:
          type:
            - 'null'
            - object
          additionalProperties:
            type: array
            items:
              type: string
      description: >-
        API extension of ProblemDetails that surfaces the stable error code,

        trace identifier, timestamp, optional target, and optional field-keyed
        validation

        error map alongside the RFC 7807 members.
    AgentToolKqlTableColumnsResult:
      type: object
      properties:
        success:
          type: boolean
          description: >-
            True when at least one requested table matched the schema. False
            when none matched, on XDR-only workspaces, or on upstream
            schema-fetch failures — reason in `summary`.
        summary:
          type:
            - 'null'
            - string
          description: >-
            Compact human-readable digest: 'Resolved N table(s) with M column(s)
            total.' plus a list of unknown names when any failed to resolve.
        tables:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/AgentToolKqlTable'
          description: >-
            Per-table column metadata for the names that resolved. Order follows
            the request input.
        unknown_table_names:
          type:
            - 'null'
            - array
          items:
            type: string
          description: >-
            Names from the request that did not resolve to a real table. Empty
            when every requested name was found. Use this to retry with
            corrected names or to back off and call list-kql-tables again.
      description: Result of the agent's get-KQL-table-columns tool.
    ResponseMeta:
      type: object
      properties:
        requestId:
          type:
            - 'null'
            - string
        timestamp:
          type:
            - 'null'
            - string
    AgentToolKqlTable:
      type: object
      properties:
        name:
          type:
            - 'null'
            - string
          description: >-
            Table name as it appears in Log Analytics. Use this verbatim in KQL
            queries.
        columns:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/AgentToolKqlColumn'
          description: >-
            Columns defined on this table. Order follows the table's schema
            definition.
    AgentToolKqlColumn:
      type: object
      properties:
        name:
          type:
            - 'null'
            - string
          description: >-
            Column name. Use verbatim in KQL queries — column names are
            case-sensitive in Kusto.
        type:
          type:
            - 'null'
            - string
          description: >-
            Column data type as Kusto names it (e.g. 'string', 'datetime',
            'long', 'real', 'bool', 'dynamic', 'guid'). Use to decide on
            appropriate operators and casts in your KQL.

````