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

# List MCP usage records

> Returns recent MCP usage rows filtered by `success`.



## OpenAPI

````yaml https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/usage.yaml get /api/usage/mcp
openapi: 3.0.3
info:
  title: Insforge Usage API
  version: 1.0.0
  description: MCP usage tracking and usage statistics for the backend usage module.
servers: []
security: []
tags:
  - name: Usage
    description: Record MCP tool usage and fetch usage summaries.
paths:
  /api/usage/mcp:
    get:
      tags:
        - Usage
      summary: List MCP usage records
      description: Returns recent MCP usage rows filtered by `success`.
      parameters:
        - name: limit
          in: query
          schema:
            type: integer
            default: 5
          description: Maximum number of usage records to return.
        - name: success
          in: query
          schema:
            type: boolean
            default: true
          description: Filter records by success state.
      responses:
        '200':
          description: MCP usage records
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/McpUsageListResponse'
              example:
                records:
                  - tool_name: generate_report
                    success: true
                    created_at: '2026-08-04T04:30:00.000Z'
                  - tool_name: sync_docs
                    success: true
                    created_at: '2026-08-04T03:15:00.000Z'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: AUTH_INVALID_CREDENTIALS
                message: No admin token provided
                statusCode: 401
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: AUTH_UNAUTHORIZED
                message: Admin access required
                statusCode: 403
        '500':
          description: Failed to get MCP usage
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: INTERNAL_ERROR
                message: Failed to get MCP usage
                statusCode: 500
      security:
        - bearerAuth: []
        - apiKey: []
components:
  schemas:
    McpUsageListResponse:
      type: object
      required:
        - records
      properties:
        records:
          type: array
          items:
            $ref: '#/components/schemas/McpUsageRecord'
    ErrorResponse:
      type: object
      required:
        - error
        - message
        - statusCode
      properties:
        error:
          type: string
        message:
          type: string
        statusCode:
          type: integer
        nextActions:
          type: string
    McpUsageRecord:
      type: object
      required:
        - tool_name
        - success
        - created_at
      properties:
        tool_name:
          type: string
        success:
          type: boolean
        created_at:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````