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

# Submit tool execution

> Append a tool execution record to a call.

This endpoint is primarily used by SLNG-managed agent runtimes to report
contextual and system tool activity back to the Agents API.




## OpenAPI

````yaml /api-reference/agents/agents.oas.yaml post /v1/agents/{agent_id}/calls/{call_id}/tool-executions
openapi: 3.0.3
info:
  title: SLNG Voice Agents API
  version: 1.0.0
  description: >
    Public API for managing Voice Agents, dispatching outbound calls, and
    creating web (non-telephony) sessions.


    Base URL: `https://api.agents.slng.ai`
  contact:
    name: SLNG Support
    email: support@slng.ai
servers:
  - url: https://api.agents.slng.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Agents
    description: Voice agent CRUD.
  - name: Calls
    description: Call dispatch and status.
  - name: Sessions
    description: Web (non-telephony) sessions.
paths:
  /v1/agents/{agent_id}/calls/{call_id}/tool-executions:
    parameters:
      - $ref: '#/components/parameters/AgentIdPath'
      - $ref: '#/components/parameters/CallIdPath'
    post:
      tags:
        - Calls
      summary: Submit tool execution
      description: |
        Append a tool execution record to a call.

        This endpoint is primarily used by SLNG-managed agent runtimes to report
        contextual and system tool activity back to the Agents API.
      operationId: submitCallToolExecution
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentCallToolExecutionCreate'
      responses:
        '204':
          description: Tool execution recorded.
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '422':
          $ref: '#/components/responses/ValidationError'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    AgentIdPath:
      name: agent_id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
      description: Voice agent ID.
    CallIdPath:
      name: call_id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
      description: Call ID.
  schemas:
    AgentCallToolExecutionCreate:
      type: object
      additionalProperties: false
      required:
        - tool_name
        - tool_kind
        - invocation_source
        - started_at
        - finished_at
        - duration_ms
        - outcome
      properties:
        tool_id:
          type: string
          maxLength: 255
          nullable: true
        tool_name:
          type: string
          minLength: 1
          maxLength: 255
        tool_kind:
          $ref: '#/components/schemas/ToolExecutionKind'
        invocation_source:
          $ref: '#/components/schemas/ToolInvocationSource'
        trigger_event:
          type: string
          minLength: 1
          maxLength: 64
          nullable: true
        source_tool_id:
          type: string
          maxLength: 255
          nullable: true
        started_at:
          $ref: '#/components/schemas/DateTime'
        finished_at:
          $ref: '#/components/schemas/DateTime'
        duration_ms:
          type: integer
          minimum: 0
        outcome:
          $ref: '#/components/schemas/ToolExecutionOutcome'
        http_status:
          type: integer
          minimum: 100
          maximum: 999
          nullable: true
        error_code:
          type: string
          maxLength: 128
          nullable: true
        error_type:
          type: string
          maxLength: 200
          nullable: true
        wait_for_response:
          type: boolean
          nullable: true
        show_results_to_llm:
          type: boolean
          nullable: true
        target_url:
          type: string
          maxLength: 1024
          nullable: true
          description: Sanitized target URL without query string or fragment details.
        arguments_preview:
          nullable: true
        result_preview:
          nullable: true
        error_message:
          type: string
          maxLength: 5000
          nullable: true
        stack_trace:
          type: string
          maxLength: 20000
          nullable: true
    UUID:
      type: string
      format: uuid
      example: 550e8400-e29b-41d4-a716-446655440000
    ToolExecutionKind:
      type: string
      enum:
        - webhook
        - template
        - human_transfer
        - built_in
    ToolInvocationSource:
      type: string
      enum:
        - system
        - contextual
    DateTime:
      type: string
      format: date-time
      example: '2026-01-15T10:30:00Z'
    ToolExecutionOutcome:
      type: string
      enum:
        - succeeded
        - failed
        - timed_out
        - skipped
        - cancelled
    ErrorResponse:
      type: object
      additionalProperties: true
      description: >
        Error payloads can vary depending on where the error is raised (edge
        gateway vs backend).


        Common shapes include:

        - `{ "error": "message" }`

        - `{ "detail": "message" }`

        - `{ "detail": [ { "loc": [...], "msg": "...", "type": "..." } ] }`
        (validation)
      properties:
        error:
          type: string
        detail:
          oneOf:
            - type: string
            - type: array
              items:
                type: object
  responses:
    UnauthorizedError:
      description: Unauthorized.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            unauthorized:
              summary: Authentication failed
              value:
                detail: Authentication is required for this endpoint.
    ForbiddenError:
      description: Forbidden.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            forbidden:
              summary: Access denied
              value:
                detail: You do not have access to this resource.
    NotFoundError:
      description: Not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            not-found:
              summary: Resource not found
              value:
                detail: The requested resource was not found.
    ValidationError:
      description: Validation error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            validation-error:
              summary: Request validation failed
              value:
                detail:
                  - loc:
                      - body
                      - language
                    msg: Input should be a valid string
                    type: string_type
    InternalServerError:
      description: Internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            internal-server-error:
              summary: Unexpected application error
              value:
                detail: An unexpected internal error occurred.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key

````