---
title: "Get MCP tool logs"
method: GET
path: "/api/mcp-logs"
tags: ["Logging"]
---

# Get MCP tool logs

`GET /api/mcp-logs`

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

## Query parameters

- `tool_names` string
- `server_labels` string
- `status` 'processing' | 'success' | 'error'
- `virtual_key_ids` string
- `llm_request_ids` string
- `start_time` string, date-time
- `end_time` string, date-time
- `min_latency` number
- `max_latency` number
- `content_search` string
- `limit` integer
- `offset` integer
- `sort_by` 'timestamp' | 'latency' | 'cost'
- `order` 'asc' | 'desc'

## Response `200`

Successful response

- object — Search MCP logs response
  - `logs` object[]
    - `id` string — Unique identifier for the log entry
    - `llm_request_id` string — Links to the LLM request that triggered this tool call
    - `timestamp` string, date-time — When the tool execution started
    - `tool_name` string — Name of the MCP tool that was executed
    - `server_label` string — Label of the MCP server that provided the tool
    - `virtual_key_id` string — ID of the virtual key used for this tool execution
    - `virtual_key_name` string — Name of the virtual key used for this tool execution
    - `arguments` object — Tool execution arguments
    - `result` object — Tool execution result
    - `error_details` BifrostError — Error response from Bifrost
      - `event_id` string
      - `type` string
      - `is_bifrost_error` boolean
      - `status_code` integer
      - `error` ErrorField
        - `type` string
        - `code` string
        - `message` string
        - `param` string
        - `event_id` string
      - `extra_fields` BifrostErrorExtraFields
        - `provider` 'openai' | 'azure' | 'anthropic' | 'bedrock' | 'cohere' | 'vertex' | 'vllm' | 'mistral' | 'ollama' | 'groq' | 'sgl' | 'parasail' | 'perplexity' | 'replicate' | 'cerebras' | 'deepseek' | 'gemini' | 'openrouter' | 'elevenlabs' | 'huggingface' | 'nebius' | 'xai' | 'runway' | 'fireworks' — AI model provider identifier
        - `model_requested` string
        - `request_type` string
    - `latency` number — Execution time in milliseconds
    - `cost` number — Cost in dollars for this tool execution
    - `status` 'processing' | 'success' | 'error' — Execution status
    - `metadata` object — Custom metadata captured from request headers (configured via logging_headers or x-bf-lh-* prefix)
    - `created_at` string, date-time — When the log entry was created
    - `virtual_key` object — Full virtual key object (populated when virtual_key_id is set)
  - `pagination` object
    - `limit` integer
    - `offset` integer
    - `sort_by` string
    - `order` string
    - `total_count` integer, required — Total number of items matching the query
  - `has_logs` boolean — Whether any logs exist in the system

## Other responses

- `400` — Bad request
- `500` — Internal server error

---

[API](https://skmtc.net/getbifrost/apis/bifrost-api.md) · [All operations](https://skmtc.net/getbifrost/apis/bifrost-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getbifrost/bifrost-api/versions/f8cab88f64ea/schema)
