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

# Get Agent

> Retrieve detailed information about a specific agent



## OpenAPI

````yaml openapi.json get /agents/{agentId}
openapi: 3.1.0
info:
  title: Ag.dev API
  description: Public API for Ag.dev
  version: 0.1.0
servers:
  - url: https://api.ag.dev/v0.1
security: []
tags:
  - name: Agents
    description: Agent management and configuration
  - name: Runs
    description: Agent run execution and monitoring
  - name: Versioning
    description: Agent versioning, revisions, and publishing
  - name: MCP Servers
    description: MCP server management and tool discovery
  - name: Settings
    description: Organization settings and API keys
  - name: Users
    description: User information and authentication
  - name: Drives
    description: Drive management and file operations
  - name: Webhooks
    description: Webhook health checks
paths:
  /agents/{agentId}:
    get:
      tags:
        - Agents
      summary: Get Agent
      description: Retrieve detailed information about a specific agent
      parameters:
        - name: agentId
          in: path
          required: true
          schema:
            type: string
            description: Agent ID
      responses:
        '200':
          description: Agent details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent'
        '401':
          description: Authentication required
        '404':
          description: Agent not found
      security:
        - ApiKeyAuth: []
components:
  schemas:
    Agent:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the agent
        modelStackId:
          type: string
          description: The model stack used by the agent
        name:
          type: string
          nullable: true
          description: Human-readable name for the agent
        description:
          type: string
          nullable: true
          description: Human-readable description for the agent
        webhookUrl:
          type: string
          format: uri
          nullable: true
          description: Webhook URL for run completion notifications
        inputSchema:
          type: object
          description: JSON schema defining input structure
        goalPrompt:
          type: string
          description: The main goal prompt for the agent
        customPlanningInstructions:
          type: string
          nullable: true
          description: Custom planning instructions
        customToolCallInstructions:
          type: string
          nullable: true
          description: Custom tool call instructions
        customResultInstructions:
          type: string
          nullable: true
          description: Custom result formatting instructions
        enableContextCompression:
          type: boolean
          description: Whether context compression is enabled
        tools:
          type: array
          items:
            $ref: '#/components/schemas/AgentTool'
          description: Available tools for the agent
        resultType:
          type: string
          enum:
            - document
            - json
          description: Type of result the agent produces
        resultSchema:
          type: object
          nullable: true
          description: JSON schema for result validation (only for json result type)
        isActive:
          type: boolean
          description: Whether the agent is active
        createdAt:
          type: string
          format: date-time
          description: Agent creation timestamp
        updatedAt:
          type: string
          format: date-time
          description: Agent last update timestamp
      required:
        - id
        - modelStackId
        - inputSchema
        - goalPrompt
        - tools
        - resultType
        - isActive
        - createdAt
        - updatedAt
    AgentTool:
      oneOf:
        - type: object
          properties:
            source:
              type: string
              enum:
                - builtin
            type:
              type: string
              enum:
                - searchWeb
                - searchNews
                - browseWebsite
                - codeInterpreter
          required:
            - source
            - type
        - type: object
          properties:
            source:
              type: string
              enum:
                - mcp
            serverId:
              type: string
              description: ID of the MCP server to use
            enabledTools:
              type: array
              items:
                type: string
              description: List of tools to enable from the MCP server
          required:
            - source
            - serverId
            - enabledTools
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'Provide either X-API-Key: <key> or Authorization: Bearer <key>'

````