Logging

Get MCP tool logs

Retrieves MCP tool execution logs with filtering, search, and pagination via query parameters.

GET
/api/mcp-logs
AuthorizationBearer <token>

Bearer token authentication. Use your MPilot virtual-key JWT or admin JWT. Virtual keys (prefixed with sk-bf-) can also be passed here.

In: header

Query Parameters

tool_names?string

Comma-separated list of tool names to filter by

server_labels?string

Comma-separated list of server labels to filter by

status?string

Comma-separated list of statuses to filter by (processing, success, error)

Value in"processing" | "success" | "error"
virtual_key_ids?string

Comma-separated list of virtual key IDs to filter by

llm_request_ids?string

Comma-separated list of LLM request IDs to filter by

start_time?string

Start time filter (RFC3339 format)

Formatdate-time
end_time?string

End time filter (RFC3339 format)

Formatdate-time
min_latency?number

Minimum latency filter (milliseconds)

max_latency?number

Maximum latency filter (milliseconds)

content_search?string

Search in tool arguments and results

limit?integer

Number of logs to return (default 50, max 1000)

Default50
Rangevalue <= 1000
offset?integer

Number of logs to skip

Default0
sort_by?string

Field to sort by

Default"timestamp"
Value in"timestamp" | "latency" | "cost"
order?string

Sort order

Default"desc"
Value in"asc" | "desc"

Response Body

curl -X GET "https://loading/{AI_GATEWAY_URL}/api/mcp-logs?tool_names=string&server_labels=string&status=processing&virtual_key_ids=string&llm_request_ids=string&start_time=2019-08-24T14%3A15%3A22Z&end_time=2019-08-24T14%3A15%3A22Z&min_latency=0&max_latency=0&content_search=string&limit=50&offset=0&sort_by=timestamp&order=asc"
{
  "logs": [
    {
      "id": "string",
      "llm_request_id": "string",
      "timestamp": "2019-08-24T14:15:22Z",
      "tool_name": "string",
      "server_label": "string",
      "virtual_key_id": "string",
      "virtual_key_name": "string",
      "arguments": {},
      "result": {},
      "error_details": {
        "event_id": "string",
        "type": "string",
        "is_bifrost_error": true,
        "status_code": 0,
        "error": {
          "type": "string",
          "code": "string",
          "message": "string",
          "param": "string",
          "event_id": "string"
        },
        "extra_fields": {
          "provider": "openai",
          "model_requested": "string",
          "request_type": "string"
        }
      },
      "latency": 0,
      "cost": 0,
      "status": "processing",
      "metadata": {},
      "created_at": "2019-08-24T14:15:22Z",
      "virtual_key": {}
    }
  ],
  "pagination": {
    "limit": 0,
    "offset": 0,
    "sort_by": "string",
    "order": "string",
    "total_count": 0
  },
  "has_logs": true
}
{
  "event_id": "string",
  "type": "string",
  "is_bifrost_error": true,
  "status_code": 0,
  "error": {
    "type": "string",
    "code": "string",
    "message": "string",
    "param": "string",
    "event_id": "string"
  },
  "extra_fields": {
    "provider": "openai",
    "model_requested": "string",
    "request_type": "string"
  }
}
{
  "event_id": "string",
  "type": "string",
  "is_bifrost_error": true,
  "status_code": 0,
  "error": {
    "type": "string",
    "code": "string",
    "message": "string",
    "param": "string",
    "event_id": "string"
  },
  "extra_fields": {
    "provider": "openai",
    "model_requested": "string",
    "request_type": "string"
  }
}
On this page

On this page

No Headings