> ## 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.

# App Execute Action

> Triggers an interaction for a custom MCP model using the provided input and operation ID. Returns the MCP-generated response.



## OpenAPI

````yaml post /api/mcp/app_execute_action
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/app_execute_action:
    post:
      tags:
        - MCP
      summary: App Execute Action
      description: >-
        Triggers an interaction for a custom MCP model using the provided input
        and operation ID. Returns the MCP-generated response.
      operationId: mcp_app_execute_action
      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: mcp
            title: App Type
          description: The type of the app ('mcp' or 'agent').
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MCPActionInput'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MCPActionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    MCPActionInput:
      properties:
        app_name:
          type: string
          title: App Name
          description: The identifier of the App to invoke.
        user_input:
          type: string
          title: User Input
          description: The natural language input describing the desired action.
        context:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Context
          description: >-
            Contextual parameters for the action, including operationId and any
            required inputs.
        response_format:
          anyOf:
            - type: string
            - type: 'null'
          title: Response Format
          description: 'Response format: ''raw'' (default) or ''formatted_md''.'
          default: raw
        customer_execution_context:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Customer Execution Context
          description: >-
            Customer-specific context data for correlation and tracking in
            customer execution mode
      type: object
      required:
        - app_name
        - user_input
      title: MCPActionInput
      description: >-
        Input payload for triggering a MCP action. Contains the user's input and
        operation ID.
    MCPActionResponse:
      properties:
        message:
          title: Message
          description: The response message or result from the MCP action
      type: object
      required:
        - message
      title: MCPActionResponse
      description: >-
        Response model for a MCP action. Contains the message or result returned
        by the MCP action.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      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}'

````