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

# Update Agent



## OpenAPI

````yaml /api-v2.json put /agents/{agent_id}
openapi: 3.1.0
info:
  title: Meibel AI API
  summary: Meibel Gateway Service
  description: >-
    Our API allows you to interact with our services. Read the
    [docs](https://docs.meibel.ai) to learn how to use it.
  version: 0.6.4
servers:
  - url: https://api.meibel.ai/v2
    description: Meibel API (v2)
  - url: https://api.dev.meibel.ai/v2
    description: Meibel Dev API (v2)
  - url: http://localhost:8000/v2
    description: Local Development
security: []
tags:
  - name: Datasources
    description: v2 datasource management
  - name: Data Elements
    description: v2 data element CRUD and search
  - name: File Upload
    description: Upload files to a datasource and track upload progress
  - name: Ingest
    description: Trigger and monitor datasource ingestion
  - name: Datasource Downloads
    description: Export all datasource content as a zip archive
  - name: Table Descriptions
    description: v2 table and column descriptions
  - name: Metadata Model Catalog
    description: v2 metadata model catalog
  - name: Confidence Scoring
    description: v2 confidence scoring jobs and summaries
  - name: Documents
    description: Parse and transform documents into structured data
  - name: Agents
    description: Agent definition management
  - name: Sessions
    description: Agent session (execution) management and chat
  - name: Artifact Schemas
    description: Agent artifact schema management
paths:
  /agents/{agent_id}:
    put:
      tags:
        - Agents
      summary: Update Agent
      operationId: updateAgent
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAgentDefinitionRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateAgentDefinitionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
      x-codeSamples:
        - lang: Python
          label: Python
          source: |-
            from meibel import MeibelClient

            client = MeibelClient(api_key="your-api-key")

            # Create request body
            body = UpdateAgentDefinitionRequest(name="Example")

            result = client.agents.update("agent_id_value", body=body)
            print(result)
        - lang: TypeScript
          label: TypeScript
          source: |-
            import { MeibelClient } from 'meibel';

            const client = new MeibelClient({ apiKey: 'your-api-key' });

            // Create request body
            const body = { name: 'Example' };

            const result = await client.agents.update('agent_id_value', body);
            console.log(result);
        - lang: Go
          label: Go
          source: |-
            import v2 "github.com/meibel-ai/meibel-go/v2"

            client := v2.NewClient(v2.WithAPIKey("your-api-key"))
            ctx := context.Background()

            // Create request body
            body := v2.UpdateAgentDefinitionRequest{
                Name: "Example",
            }

            result, err := client.Agents.Update(ctx, "agent_id_value", body)
            if err != nil {
                log.Fatal(err)
            }
            fmt.Println(result)
components:
  schemas:
    UpdateAgentDefinitionRequest:
      properties:
        display_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Display Name
          description: Human-readable name of the agent
        instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: Instructions
          description: System prompt/instructions
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
          description: Agent type
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Description of the agent
        llm_model:
          anyOf:
            - type: string
            - type: 'null'
          title: Llm Model
          description: LLM model to use
        fallback_models:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Fallback Models
          description: List of fallback models
        datasources:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Datasources
          description: Datasource IDs the agent has access to
        tools:
          anyOf:
            - items:
                $ref: '#/components/schemas/AgentToolDefinition'
              type: array
            - type: 'null'
          title: Tools
          description: Tools configuration
        artifacts:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Artifacts
          description: Catalog URNs of artifacts the agent produces
        confidence_configs:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Confidence Configs
          description: Confidence scoring module names to apply during execution
        temperature:
          anyOf:
            - type: number
              maximum: 2
              minimum: 0
            - type: integer
              maximum: 2
              minimum: 0
            - type: 'null'
          title: Temperature
          description: LLM temperature
        max_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Tokens
          description: Maximum tokens in response
        tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tags
          description: Tags for categorization
        icon:
          anyOf:
            - type: string
            - type: 'null'
          title: Icon
          description: UI icon identifier
      type: object
      title: UpdateAgentDefinitionRequest
      description: >-
        Request model for updating an agent definition. Name is intentionally
        excluded as it serves as the stable identifier for a version chain and
        cannot be changed.
    UpdateAgentDefinitionResponse:
      properties:
        id:
          type: string
          title: Id
          description: New agent definition ID
        catalog_urn:
          type: string
          title: Catalog Urn
          description: Catalog URN for the new version
        version:
          type: string
          title: Version
          description: New version number
      type: object
      required:
        - id
        - catalog_urn
        - version
      title: UpdateAgentDefinitionResponse
      description: Response model for updating an agent definition.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AgentToolDefinition:
      properties:
        name:
          type: string
          title: Name
          description: Instance name - what the LLM sees and calls
        type:
          type: string
          title: Type
          description: 'Tool type: rag_search, database_query, etc.'
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Description shown to LLM
          default: ''
        config:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Config
          description: >-
            Tool config passed to activity via tool_context (datasource_id,
            base_prompt, etc.)
        parameters_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Parameters Schema
          description: Optional override for the tool's parameters schema
        use_for:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Use For
          description: When to use this tool (injected into system prompt)
        avoid_for:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Avoid For
          description: When NOT to use this tool (injected into system prompt)
        require_approval:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Require Approval
          description: >-
            If true, workflow pauses for human approval before executing this
            tool
          default: false
        approval_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Approval Message
          description: >-
            Message to display when requesting approval (supports {{variable}}
            templates)
      type: object
      required:
        - name
        - type
      title: AgentToolDefinition
      description: AgentToolDefinition
    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
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: Meibel-API-Key

````