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

# Improve agent instructions

> Use AI to suggest improved agent instructions.



## OpenAPI

````yaml /api-reference/openapi.json post /api/agents/{id}/improve-instructions
openapi: 3.1.0
info:
  title: Tedro API
  version: 1.0.0
  description: REST API for the Tedro communication operations platform.
servers:
  - url: https://api.tedro.io
    description: Production
security:
  - sessionCookie: []
    workspaceId: []
paths:
  /api/agents/{id}/improve-instructions:
    post:
      tags:
        - Agents
      summary: Improve agent instructions
      description: Use AI to suggest improved agent instructions.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImproveInstructions'
      responses:
        '200':
          description: Improved instructions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImproveInstructionsResponse'
        '400':
          description: Bad Request - invalid or missing parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '401':
          description: Unauthorized - missing or invalid session cookie
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found - resource does not exist or belongs to another tenant
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - sessionCookie: []
          workspaceId: []
components:
  schemas:
    ImproveInstructions:
      type: object
      properties:
        currentInstructions:
          type: string
          minLength: 1
        role:
          type: string
        tone:
          type: string
        answerLength:
          type: string
      required:
        - currentInstructions
      additionalProperties: false
      description: Use AI to improve agent instructions
      example:
        currentInstructions: Answer customer questions.
        tone: professional
    ImproveInstructionsResponse:
      type: object
      properties:
        instructions:
          type: string
      required:
        - instructions
    ValidationErrorResponse:
      type: object
      properties:
        error:
          type: string
        details:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
              message:
                type: string
            required:
              - path
              - message
      required:
        - error
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
      required:
        - error
  securitySchemes:
    sessionCookie:
      type: apiKey
      in: cookie
      name: better-auth.session_token
      description: Session cookie set by Better Auth on sign-in.
    workspaceId:
      type: apiKey
      in: header
      name: x-workspace-id
      description: Workspace UUID. Required on all /api/* endpoints.

````