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

# List Contexts

> List all context names available for the specified agent.
Returns a list of context names that the agent has access to.



## OpenAPI

````yaml get /api/mcp/list_contexts
openapi: 3.1.0
info:
  title: Apigene
  description: Apigene API
  version: 1.0.0
  contact:
    name: Apigene Support
    url: https://app.apigene.ai
    email: support@apigene.ai
servers:
  - url: https://app.apigene.ai
security:
  - BearerAuth: []
paths:
  /api/mcp/list_contexts:
    get:
      tags:
        - MCP
      summary: List Contexts
      description: |-
        List all context names available for the specified agent.
        Returns a list of context names that the agent has access to.
      operationId: list_contexts
      parameters:
        - name: genai_app
          in: query
          required: true
          schema:
            type: string
            description: The name of the GenAI app.
            title: Genai App
          description: The name of the GenAI app.
        - name: app_type
          in: query
          required: false
          schema:
            type: string
            description: The type of the app ('mcp' or 'agent').
            default: agent
            title: App Type
          description: The type of the app ('mcp' or 'agent').
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MCPContextListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    MCPContextListResponse:
      properties:
        context_list:
          items:
            $ref: '#/components/schemas/Context'
          type: array
          title: Context List
          description: List of context names
      type: object
      required:
        - context_list
      title: MCPContextListResponse
      description: Response model for listing context. Contains the list of context.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Context:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the context
        name:
          type: string
          title: Name
          description: Name of the context
        description:
          type: string
          title: Description
          description: Description of the context
        apps:
          items:
            type: string
          type: array
          title: Apps
          description: List of associated apps
          default: []
        summary:
          type: string
          title: Summary
          description: A short summary about the context
          default: ''
        when_to_use:
          type: string
          title: When To Use
          description: A short summary explaining to LLM when to apply the context
          default: ''
        type:
          type: string
          title: Type
          description: A string to classify the context type
          default: ''
        status:
          type: string
          title: Status
          description: 'Status of the context: active or disabled'
          default: active
        created_by:
          type: string
          title: Created By
          description: User who created the context
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The date and time when the context was created.
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: The date and time when the context was last updated.
      type: object
      required:
        - id
        - name
        - description
        - created_by
        - created_at
        - updated_at
      title: Context
    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:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Authorization header using the Bearer scheme. Example:
        'Authorization: Bearer {token}'

````

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