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

# Keep each tool call's full output

> Keeps the full arguments and output of each finished tool call, so an operator can open everything a call took and returned. Post before the report. A body is at most 262144 bytes, and each record's arguments and output at most 65536 bytes each. An event keeps at most 1 MiB of records. A record that breaks a bound or does not fit is counted in `skipped_count` and the rest are kept. Posting a call again replaces its record, so a retry is safe. A lease the fleet has moved past is refused and keeps nothing. 



## OpenAPI

````yaml https://raw.githubusercontent.com/agentsfleet/agentsfleet/main/public/openapi.json post /v1/runners/me/leases/{lease_id}/tool-calls
openapi: 3.1.0
info:
  title: agentsfleet Control Plane API
  description: API for managing workspaces, fleets, triggers, and runs.
  contact:
    name: agentsfleet
    url: https://agentsfleet.net
  license:
    name: MIT
    identifier: MIT
  version: 1.0.0
servers:
  - url: https://api.agentsfleet.net
    description: Production
security: []
paths:
  /v1/runners/me/leases/{lease_id}/tool-calls:
    post:
      tags:
        - Runners
      summary: Keep each tool call's full output
      description: >-
        Keeps the full arguments and output of each finished tool call, so an
        operator can open everything a call took and returned. Post before the
        report. A body is at most 262144 bytes, and each record's arguments and
        output at most 65536 bytes each. An event keeps at most 1 MiB of
        records. A record that breaks a bound or does not fit is counted in
        `skipped_count` and the rest are kept. Posting a call again replaces its
        record, so a retry is safe. A lease the fleet has moved past is refused
        and keeps nothing. 
      operationId: runner_record_tool_calls
      parameters:
        - name: lease_id
          in: path
          description: '`UUIDv7` of the lease.'
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ToolCallRecordsRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolCallRecordsStored'
        '400':
          description: The request could not be read
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '401':
          description: No credential, or one this route does not accept
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '403':
          description: The credential is good and lacks the capability this route requires
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '404':
          description: No such resource, or none this caller may see
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '409':
          description: The request conflicts with the resource's current state
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '413':
          description: The payload is over this route's ceiling
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '429':
          description: The instance is at its ceiling
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '500':
          description: The daemon failed to answer
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '503':
          description: A dependency this route needs is unreachable
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
      security:
        - RunnerBearerAuth: []
components:
  schemas:
    ToolCallRecordsRequest:
      type: object
      description: '`POST /v1/runners/me/leases/{lease_id}/tool-calls` request.'
      required:
        - fencing_token
        - calls
      properties:
        calls:
          type: array
          items:
            $ref: '#/components/schemas/ToolCallRecord'
          description: The finished calls to keep. A call posted again replaces its record.
        fencing_token:
          type: integer
          format: int64
          description: >-
            The lease's fencing token; a holder the fleet has superseded is
            refused.
          minimum: 0
      additionalProperties: false
    ToolCallRecordsStored:
      type: object
      description: What a post kept.
      required:
        - stored_count
        - skipped_count
      properties:
        skipped_count:
          type: integer
          description: >-
            Records refused for their shape, a bound, or the event's budget.
            Beta: this field may change shape before it is stable.
          minimum: 0
          x-stability: beta
        stored_count:
          type: integer
          description: >-
            Records written or replaced. Beta: this field may change shape
            before it is stable.
          minimum: 0
          x-stability: beta
    ProblemBody:
      type: object
      description: The body every refusal carries, under `application/problem+json`.
      required:
        - docs_uri
        - title
        - detail
        - error_code
        - request_id
      properties:
        action_id:
          type:
            - string
            - 'null'
          description: 'On that 409 only: the action the gate held.'
        current_state:
          type:
            - string
            - 'null'
          description: 'On a 409 only: the state that forbade the transition.'
        detail:
          type: string
          description: One sentence on what was refused and why.
        docs_uri:
          type: string
          description: Where the error code is documented.
        error_code:
          type: string
          description: The registry code, stable across releases.
        etag:
          type:
            - string
            - 'null'
          description: >-
            On a 412 only: the resource's current entity tag, to refetch and
            retry.
        gate_id:
          type:
            - string
            - 'null'
          description: 'On an answered approval gate''s 409 only: the gate that was answered.'
        outcome:
          type:
            - string
            - 'null'
          description: 'On that 409 only: the answer that stands.'
        request_id:
          type: string
          description: The request this refusal answers, for support.
        resolved_at:
          type:
            - integer
            - 'null'
          format: int64
          description: 'On that 409 only: when the standing answer was given.'
        resolved_by:
          type:
            - string
            - 'null'
          description: 'On that 409 only: who gave it.'
        title:
          type: string
          description: A short name for the refusal, safe to show a person.
        user_message:
          type:
            - string
            - 'null'
          description: A curated sentence for end users, where the code has one.
    ToolCallRecord:
      type: object
      description: One finished call as the runner records it.
      required:
        - call_number
        - arguments
        - truncated_arguments
        - output
        - output_line_count
        - truncated
      properties:
        arguments:
          type: object
          description: |-
            Every argument the call was made with, secret values masked. At most
            65536 bytes encoded, with no NUL character.
        call_number:
          type: integer
          format: int64
          description: |-
            The call's number in its run, from 1: the `n` of the `{fence}:{n}`
            call id the live frames and the trace carry.
          maximum: 9223372036854776000
          minimum: 1
        output:
          type: string
          description: |-
            Everything the call returned, at most 65536 bytes, with no NUL
            character.
        output_line_count:
          type: integer
          format: int64
          description: How many lines the whole output had, before any cut.
          minimum: 0
        truncated:
          type: boolean
          description: Whether the runner cut the output to fit.
        truncated_arguments:
          type: boolean
          description: Whether the runner cut the arguments to fit.
      additionalProperties: false
  securitySchemes:
    RunnerBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: agt_r
      description: The opaque agt_r token minted when the runner enrols (POST /v1/runners)

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.