Skip to main content
Laminar ships an MCP (Model Context Protocol) server so AI assistants can query trace data directly. These are tools your agent can call. You ask questions in the chat, the agent invokes the Laminar tools under the hood, and you get answers grounded in your trace data. This closes the dev loop: the agent that wrote the code can pull the exact traces it produced, investigate failures, and propose fixes without context switching.

Available Tools

  • ask_agent
    Ask Laminar Agent a question in plain language and get a grounded answer back. The agent runs read-only SQL and reads trace context for you, so you do not have to write the queries yourself. Pass a prompt; the response returns a conversationId you can pass back on the next call to continue the conversation.
  • query_laminar_sql
    Run read-only ClickHouse SQL across Laminar data and get JSON back. Use this to find trace IDs, filter by time/session/status, or pull raw span fields (input, output, attributes).
  • get_trace_context
    Get an LLM-optimized summary of a single trace: span tree, timings, LLM inputs/outputs, and errors. Use this to quickly understand what happened in a specific run once you have a trace ID.
The SQL tool is read-only (SELECT only) and automatically scoped to your project. If trace context truncates long inputs or outputs, use SQL to fetch full fields.
Use ask_agent when you want a quick answer without writing SQL; use query_laminar_sql and get_trace_context when your assistant should pull raw rows or trace structure to reason over itself.

Connect Your Client

First, grab a project API key from the Laminar dashboard. Then connect your MCP client.
For self-hosted deployments, replace the base URL with your instance (for example, https://laminar.example.com/v1/mcp).

Example Questions You Can Ask Your LLM

  • “What failed in the most recent run for my dev-claude session?”
  • “Find the latest error trace and summarize the root cause.”
  • “Which tool call failed first in the last 20 minutes?”
  • “Show me the spans where the model returned an empty response today.”
  • “List the 5 slowest traces from the last hour and summarize the slowest one.”
  • “Find traces where status = 'error' and the top span name contains checkout.”
  • “Compare the token usage between the last two successful runs.”