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

# Record Mcp Tool

> Record a native MCP tool call from apigene-copilot for interaction history.

Called by the copilot after each MCP tool execution so that tool usage
appears in the same interaction store as API actions (create_interaction).



## OpenAPI

````yaml post /api/interaction/record-mcp-tool
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/interaction/record-mcp-tool:
    post:
      tags:
        - Interaction
      summary: Record Mcp Tool
      description: >-
        Record a native MCP tool call from apigene-copilot for interaction
        history.


        Called by the copilot after each MCP tool execution so that tool usage

        appears in the same interaction store as API actions
        (create_interaction).
      operationId: interaction_record_mcp_tool
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RecordMcpToolInput'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    RecordMcpToolInput:
      properties:
        tool_name:
          type: string
          title: Tool Name
          description: MCP tool name (e.g. get_design_context).
        mcp_server_name:
          type: string
          title: Mcp Server Name
          description: MCP server / app name.
        arguments:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Arguments
          description: Tool call arguments.
        result:
          title: Result
          description: Tool result (content array or object with isError, error, content).
        user_input:
          type: string
          title: User Input
          description: User message that led to this tool call.
        duration_seconds:
          anyOf:
            - type: number
            - type: 'null'
          title: Duration Seconds
          description: Tool execution duration in seconds.
        conversation_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Conversation Id
          description: Thread/conversation ID for correlation.
        client_source:
          anyOf:
            - type: string
            - type: 'null'
          title: Client Source
          description: Client that initiated the call.
          default: apigene-copilot
      type: object
      required:
        - tool_name
        - mcp_server_name
        - result
        - user_input
      title: RecordMcpToolInput
      description: Input for recording a native MCP tool call from apigene-copilot.
    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
        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}'

````