LangSmith MCP Server
OfficialThe LangSmith MCP Server enables language models to access and manage LangSmith observability platform data through a Model Context Protocol interface.
Conversation History: Retrieve paginated message history from conversation threads using character-based pagination
Prompt Management: List prompts with visibility filtering (public/private), get specific prompts by name, and get guidance on creating/pushing prompts
Traces & Runs: Fetch runs (LLM, chain, tool, retriever, etc.) from one or more projects with powerful Filter Query Language (FQL) support, filtering by run type, error status, root status, and trace ID; list projects with optional name filtering
Datasets & Examples: List datasets filtered by ID, type, name, or metadata; read individual datasets/examples; fetch examples with filtering, pagination, versioning, and splits; get guidance on creating datasets and updating examples
Experiments & Evaluations: List experiment projects for a given dataset with key metrics (latency p50/p99, cost, feedback stats) and get guidance on running experiments
Billing & Usage: Fetch organization billing usage (e.g., trace counts) for a specified date range with optional workspace filtering
Flexible Output & Deployment: Fetch runs in
pretty,json, orrawformats; deploy via hosted HTTP endpoint, Docker container, or local PyPI installationCharacter-Based Pagination: Stateless character-budget pagination (
page_number,max_chars_per_page,preview_chars) keeps responses within LLM context limits
Provides seamless integration with the LangSmith observability platform, enabling language models to fetch conversation history, manage prompts, retrieve traces and runs, work with datasets and examples, and access experiment and evaluation data from LangSmith projects.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@LangSmith MCP Server fetch the history of my conversation from thread 'thread-123' in project 'my-chatbot'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π¦π οΈ LangSmith MCP Server

A production-ready Model Context Protocol (MCP) server that provides seamless integration with the LangSmith observability platform. This server enables language models to fetch conversation history, prompts, runs and traces, datasets, experiments, and billing usage from LangSmith.
π Example Use Cases
The server enables powerful capabilities including:
π¬ Conversation History: "Fetch the history of my conversation from thread 'thread-123' in project 'my-chatbot'" (paginated by character budget)
π Prompt Management: "Get all public prompts in my workspace" / "Pull the template for the 'legal-case-summarizer' prompt"
π Traces & Runs: "Fetch the latest 10 root runs from project 'alpha'" / "Get all runs for trace <uuid> (page 2 of 5)"
π Datasets: "List datasets of type chat" / "Read examples from dataset 'customer-support-qa'"
π§ͺ Experiments: "List experiments for dataset 'my-eval-set' with latency and cost metrics"
π Billing: "Get billing usage for September 2025"
Related MCP server: AgentLens MCP Server
π Quickstart
A hosted version of the LangSmith MCP Server is available over HTTP-streamable transport, so you can connect without running the server yourself:
URL:
https://langsmith-mcp-server.onrender.com/mcpHosting: Render, built from this public repo using the project's Dockerfile.
Use it like any HTTP-streamable MCP server: point your client at the URL and send your LangSmith API key in the LANGSMITH-API-KEY header. No local install or Docker required.
Example (Cursor mcp.json):
{
"mcpServers": {
"LangSmith MCP (Hosted)": {
"url": "https://langsmith-mcp-server.onrender.com/mcp",
"headers": {
"LANGSMITH-API-KEY": "lsv2_pt_your_api_key_here"
}
}
}
}Optional headers: LANGSMITH-WORKSPACE-ID, LANGSMITH-ENDPOINT (same as in the Docker Deployment section below).
Note: This deployed instance is intended for LangSmith Cloud. If you use a self-hosted LangSmith instance, run the server yourself and point it at your endpointβsee the Docker Deployment section below.
π οΈ Available Tools
The LangSmith MCP Server provides the following tools for integration with LangSmith.
π¬ Conversation & Threads
Tool Name | Description |
| Retrieve message history for a conversation thread. Uses char-based pagination: pass |
π Prompt Management
Tool Name | Description |
| Fetch prompts from LangSmith with optional filtering by visibility (public/private) and limit. |
| Get a specific prompt by its exact name, returning the prompt details and template. |
| Documentation-only: how to create and push prompts to LangSmith. |
π Traces & Runs
Tool Name | Description |
| Fetch LangSmith runs (traces, tools, chains, etc.) from one or more projects. Supports filters (run_type, error, is_root), FQL ( |
| List LangSmith projects with optional filtering by name, dataset, and detail level (simplified vs full). |
π Datasets & Examples
Tool Name | Description |
| Fetch datasets with filtering by ID, type, name, name substring, or metadata. |
| Fetch examples from a dataset by dataset ID/name or example IDs, with filter, metadata, splits, and optional |
| Read a single dataset by ID or name. |
| Read a single example by ID, with optional |
| Documentation-only: how to create datasets in LangSmith. |
| Documentation-only: how to update dataset examples in LangSmith. |
π§ͺ Experiments & Evaluations
Tool Name | Description |
| List experiment projects (reference projects) for a dataset. Requires |
| Documentation-only: how to run experiments and evaluations in LangSmith. |
π Usage & Billing
Tool Name | Description |
| Fetch organization billing usage (e.g. trace counts) for a date range. Optional workspace filter; returns metrics with workspace names inline. |
π Pagination (char-based)
Several tools use stateless, character-budget pagination so responses stay within a size limit and work well with LLM clients:
Where itβs used:
get_thread_historyandfetch_runs(whentrace_idis set).Parameters: You send
page_number(1-based) on every request. Optional:max_chars_per_page(default 25000, cap 30000) andpreview_chars(truncate long strings with "β¦ (+N chars)").Response: Each response includes
page_number,total_pages, and the page payload (resultfor messages,runsfor runs). To get more, call again withpage_number = 2, then3, up tototal_pages.Why itβs useful: Pages are built by JSON character count, not item count, so each page fits within a fixed size. No cursor or server-side stateβjust integer page numbers.
π οΈ Installation Options
π General Prerequisites
Install uv (a fast Python package installer and resolver):
curl -LsSf https://astral.sh/uv/install.sh | shClone this repository and navigate to the project directory:
git clone https://github.com/langchain-ai/langsmith-mcp-server.git cd langsmith-mcp-server
π MCP Client Integration
Once you have the LangSmith MCP Server, you can integrate it with various MCP-compatible clients. You have two installation options:
π¦ From PyPI
Install the package:
uv run pip install --upgrade langsmith-mcp-serverAdd to your client MCP config:
{ "mcpServers": { "LangSmith API MCP Server": { "command": "/path/to/uvx", "args": [ "langsmith-mcp-server" ], "env": { "LANGSMITH_API_KEY": "your_langsmith_api_key", "LANGSMITH_WORKSPACE_ID": "your_workspace_id", "LANGSMITH_ENDPOINT": "https://api.smith.langchain.com" } } } }
βοΈ From Source
Add the following configuration to your MCP client settings (run from the project root so the package is found):
{
"mcpServers": {
"LangSmith API MCP Server": {
"command": "/path/to/uv",
"args": [
"--directory",
"/path/to/langsmith-mcp-server",
"run",
"langsmith_mcp_server/server.py"
],
"env": {
"LANGSMITH_API_KEY": "your_langsmith_api_key",
"LANGSMITH_WORKSPACE_ID": "your_workspace_id",
"LANGSMITH_ENDPOINT": "https://api.smith.langchain.com"
}
}
}
}Replace the following placeholders:
/path/to/uv: The absolute path to your uv installation (e.g.,/Users/username/.local/bin/uv). You can find it withwhich uv./path/to/langsmith-mcp-server: The absolute path to the project root (the directory containingpyproject.tomlandlangsmith_mcp_server/).your_langsmith_api_key: Your LangSmith API key (required).your_workspace_id: Your LangSmith workspace ID (optional, for API keys scoped to multiple workspaces).https://api.smith.langchain.com: The LangSmith API endpoint (optional, defaults to the standard endpoint).
Example configuration (PyPI/uvx):
{
"mcpServers": {
"LangSmith API MCP Server": {
"command": "/path/to/uvx",
"args": ["langsmith-mcp-server"],
"env": {
"LANGSMITH_API_KEY": "lsv2_pt_your_key_here",
"LANGSMITH_WORKSPACE_ID": "your_workspace_id",
"LANGSMITH_ENDPOINT": "https://api.smith.langchain.com"
}
}
}
}Copy this configuration into Cursor β MCP Settings (replace /path/to/uvx with the output of which uvx).

π§ Headers (tool invocation)
When connecting over HTTP (e.g. streamable HTTP or a hosted MCP endpoint), the server uses headers for authentication and configuration. Your MCP client must send these with each request; no environment variables are required for tool invocation.
Header | Required | Description |
| β Yes | Your LangSmith API key for tool calls (list prompts, fetch runs, etc.) |
| β No | Workspace ID for API keys scoped to multiple workspaces |
| β No | Custom API endpoint URL (for self-hosted or EU region) |
Optional headers used only when server monitoring is enabled (for grouping traces by session):
Header | Description |
| Session or thread id; stored in trace metadata as |
| Fallback if |
| Fallback for request-scoped grouping |
Stdio transport: When running the server over stdio (e.g. uvx langsmith-mcp-server), there are no headers. The server falls back to the environment variables LANGSMITH_API_KEY, LANGSMITH_WORKSPACE_ID, and LANGSMITH_ENDPOINT in the process environment so that tool invocation still works.
π§ Environment variables
Environment variables are not used for tool invocation when using HTTP (headers are). They are used for:
Stdio transport β fallback for credentials when no headers exist (see above).
Load tests β e.g.
tests/load_test_sessions.pyreadsLANGSMITH_API_KEYfrom the environment (or a.envfile at the project root).Optional server monitoring β tracing tool calls to a second LangSmith instance (see below).
Variable | Used for | Description |
| Stdio fallback, load tests | LangSmith API key (when not provided via headers) |
| Stdio fallback | Workspace ID (optional) |
| Stdio fallback | Custom endpoint URL (optional) |
Optional: Tool-call monitoring to a second LangSmith instance
You can log every MCP tool call (with inputs and outputs) to a separate LangSmith project for monitoring and analytics. Set these in your environment (e.g. in a .env file at the project root; the server loads .env via python-dotenv):
Variable | Required | Description |
| Yes (to enable) | API key for the LangSmith instance used for monitoring |
| No | Endpoint URL (default: cloud) |
| No | Workspace ID for the monitoring instance |
| No | Project name for monitoring traces (default: |
| Yes (to send traces) | Set to |
Each tool run is traced with run_type="tool" and a session_id in metadata (from the mcp-session-id, x-session-id, or x-request-id header when using HTTP, or generated per request).
If you use the hosted LangSmith MCP Server, anonymous usage data is sent to a separate LangSmith project so we can iterate and improve the product.
π³ Docker Deployment (HTTP-Streamable)
The LangSmith MCP Server can be deployed as an HTTP server using Docker, enabling remote access via the HTTP-streamable protocol.
Building the Docker Image
docker build -t langsmith-mcp-server .Running with Docker
docker run -p 8000:8000 langsmith-mcp-serverThe API key is provided via the LANGSMITH-API-KEY header when connecting, so no environment variables are required for HTTP-streamable protocol.
Connecting with HTTP-Streamable Protocol
Once the Docker container is running, you can connect to it using the HTTP-streamable transport. The server accepts authentication via headers:
Required header:
LANGSMITH-API-KEY: Your LangSmith API key
Optional headers:
LANGSMITH-WORKSPACE-ID: Workspace ID for API keys scoped to multiple workspacesLANGSMITH-ENDPOINT: Custom endpoint URL (for self-hosted or EU region)
Example client configuration:
from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client
headers = {
"LANGSMITH-API-KEY": "lsv2_pt_your_api_key_here",
# Optional:
# "LANGSMITH-WORKSPACE-ID": "your_workspace_id",
# "LANGSMITH-ENDPOINT": "https://api.smith.langchain.com",
}
async with streamablehttp_client("http://localhost:8000/mcp", headers=headers) as (read, write, _):
async with ClientSession(read, write) as session:
await session.initialize()
# Use the session to call tools, list prompts, etc.Cursor Integration
To add the LangSmith MCP Server to Cursor using HTTP-streamable protocol, add the following to your mcp.json configuration file:
{
"mcpServers": {
"HTTP-Streamable LangSmith MCP Server": {
"url": "http://localhost:8000/mcp",
"headers": {
"LANGSMITH-API-KEY": "lsv2_pt_your_api_key_here"
}
}
}
}Optional headers:
{
"mcpServers": {
"HTTP-Streamable LangSmith MCP Server": {
"url": "http://localhost:8000/mcp",
"headers": {
"LANGSMITH-API-KEY": "lsv2_pt_your_api_key_here",
"LANGSMITH-WORKSPACE-ID": "your_workspace_id",
"LANGSMITH-ENDPOINT": "https://api.smith.langchain.com"
}
}
}
}Make sure the server is running before connecting Cursor to it.
Health Check
The server provides a health check endpoint:
curl http://localhost:8000/healthThis endpoint does not require authentication and returns "LangSmith MCP server is running" when the server is healthy.
π§ͺ Development and Contributing
Prerequisites
Python 3.10+ (3.11+ recommended)
uv β install with
curl -LsSf https://astral.sh/uv/install.sh | shLangSmith API key β from smith.langchain.com
Node.js (optional) β only if you want to use MCP Inspector to test the server (stdio or streamable-http)
Setup
git clone https://github.com/langchain-ai/langsmith-mcp-server.git
cd langsmith-mcp-server
uv sync # Install dependencies
uv sync --group test # Include test dependencies (pytest, ruff, mypy)
uvx langsmith-mcp-server # Verify CLI runs (stdio)Development workflow
Edit code in
langsmith_mcp_server/ortests/.Format and lint (required before committing):
make format make lintRun tests:
make test # Or a single file: make test TEST_FILE=tests/tools/test_dataset_tools.pyType-check (optional):
uv run mypy langsmith_mcp_server/
Testing with MCP Inspector
You can test the server with MCP Inspector using either stdio or streamable-http.
Start MCP Inspector:
npx @modelcontextprotocol/inspector@latestOpen http://localhost:6274 in your browser.
Connect in the Inspector:
Stdio: Choose stdio transport and configure the server command (e.g.
uv run langsmith-mcp-server) and setLANGSMITH_API_KEYin the environment.Streamable HTTP: Start the server first (
uv run uvicorn langsmith_mcp_server.server:app --host 0.0.0.0 --port 8000or Docker), then choose streamable-http, URLhttp://localhost:8000/mcp, and add headerLANGSMITH-API-KEY= your API key.
Load testing
A session-based load test opens many MCP sessions and calls the list_prompts tool in each, using langchain-mcp-adapters. Run from the CLI (no UI). The server must be running first.
uv sync --group load
# Terminal 1: start the server
uv run uvicorn langsmith_mcp_server.server:app --host 0.0.0.0 --port 8000
# Terminal 2: run the load test
uv run python tests/load_test_sessions.py --sessions 20 --calls-per-session 3Options
Option | Default | Description |
|
| MCP endpoint URL |
| from |
|
| 10 | Number of concurrent sessions |
| 3 |
|
| off | Print step-by-step logs and first error traceback |
| β | Write a report after the run (see below) |
Report
Use --report PATH to write a JSON report after the test (e.g. --report load_test_report creates load_test_report.json with config, summary, per-session results, and first error).
uv run python tests/load_test_sessions.py --sessions 5 --report load_test_report
# Creates: load_test_report.json (in current directory)Contributing checklist
Before opening a PR:
make formatandmake lintpassmake testpassesNew tools or behavior are documented (e.g. in CLAUDE.md if you change architecture or tools)
Error handling in tools returns
{"error": "..."}rather than raising
For more detail (adding tools, code standards, troubleshooting), see CLAUDE.md.
π License
This project is distributed under the MIT License. For detailed terms and conditions, please refer to the LICENSE file.
Made with β€οΈ by the LangChain Team
Available Tools
13 toolscreate_datasetC
Call this tool when you need to understand how to create datasets in LangSmith.
Inputs: no named parameters. Returns: result
fetch_runsA
Fetch LangSmith runs (traces, tools, chains, etc.) from one or more projects using flexible filters, query language expressions, and trace-level constraints.
π§© PURPOSE
This is a general-purpose LangSmith run fetcher designed for analytics, trace export, and automated exploration.
It wraps client.list_runs() with complete support for:
Multiple project names or IDs
The Filter Query Language (FQL) for precise queries
Hierarchical filtering across trace trees
Sorting and result limiting
It returns raw dict objects suitable for further analysis or export.
βοΈ PARAMETERS
project_name : str The project name to fetch runs from. For multiple projects, use JSON array string (e.g., '["project1", "project2"]').
trace_id : str, optional Return only runs that belong to a specific trace tree. It is a UUID string, e.g. "123e4567-e89b-12d3-a456-426614174000".
run_type : str, optional Filter runs by type (e.g. "llm", "chain", "tool", "retriever").
error : str, optional Filter by error status: "true" for errored runs, "false" for successful runs.
is_root : str, optional Filter root traces: "true" for only top-level traces, "false" to exclude roots. If not provided, returns all runs.
filter : str, optional A Filter Query Language (FQL) expression that filters runs by fields, metadata, tags, feedback, latency, or time.
βββ Common field names βββ
- `id`, `name`, `run_type`
- `start_time`, `end_time`
- `latency`
- `total_tokens`
- `error`
- `tags`
- `feedback_key`, `feedback_score`
- `metadata_key`, `metadata_value`
- `execution_order`
βββ Supported comparators βββ
- `eq`, `neq` β equal / not equal
- `gt`, `gte`, `lt`, `lte` β numeric or time comparisons
- `has` β tag or metadata contains value
- `search` β substring or full-text match
- `and`, `or`, `not` β logical operators
βββ Examples βββ
```python
'gt(latency, "5s")' # took longer than 5 seconds
'neq(error, null)' # errored runs
'has(tags, "beta")' # runs tagged "beta"
'and(eq(name,"ChatOpenAI"), eq(run_type,"llm"))' # named & typed runs
'search("image classification")' # full-text search
```trace_filter : str, optional Filter applied to the root run in each trace tree. Lets you select child runs based on root attributes or feedback.
Example:
```python
'and(eq(feedback_key,"user_score"), eq(feedback_score,1))'
```
β return runs whose root trace has a user_score of 1.tree_filter : str, optional
Filter applied to any run in the trace tree (including siblings or children).
Example:
python 'eq(name,"ExpandQuery")'
β return runs if any run in their trace had that name.
order_by : str, default "-start_time" Sort field; prefix with "-" for descending order.
limit : int, default 50 Maximum number of runs to return.
reference_example_id : str, optional Filter runs by reference example ID. Returns only runs associated with the specified dataset example ID.
format_type : str, default "pretty"
Output format for extracted messages. Options:
- "pretty" (default): Human-readable formatted text focusing on human/AI/tool message exchanges
- "json": Pretty-printed JSON format
- "raw": Compact single-line JSON format
When format_type is set, the tool extracts messages from runs and formats them,
making it ideal for conversational AI agents that care about message exchanges
rather than full trace details. The response returns only the formatted output:
- `formatted`: Formatted string representation of messages (when format_type is provided)
When format_type is not set, the response returns:
- `runs`: Full run dataπ€ RETURNS
Dict[str, Any]
Dictionary containing:
- If format_type is set: {"formatted": str} - formatted string representation of messages
- If format_type is not set: {"runs": List[Dict]} - list of LangSmith run dictionaries
π§ͺ EXAMPLES
1οΈβ£ Get latest 10 root runs
runs = fetch_runs("alpha-project", is_root="true", limit=10)2οΈβ£ Get all tool runs that errored
runs = fetch_runs("alpha-project", run_type="tool", error="true")3οΈβ£ Get all runs that took >5s and have tag "experimental"
runs = fetch_runs("alpha-project", filter='and(gt(latency,"5s"), has(tags,"experimental"))')4οΈβ£ Get all runs in a specific conversation thread
thread_id = "abc-123"
fql = f'and(in(metadata_key, ["session_id","conversation_id","thread_id"]), eq(metadata_value, "{thread_id}"))'
runs = fetch_runs("alpha-project", is_root="true", filter=fql)5οΈβ£ List all runs called "extractor" whose root trace has feedback user_score=1
runs = fetch_runs(
"alpha-project",
filter='eq(name,"extractor")',
trace_filter='and(eq(feedback_key,"user_score"), eq(feedback_score,1))'
)6οΈβ£ List all runs that started after a timestamp and either errored or got low feedback
fql = 'and(gt(start_time,"2023-07-15T12:34:56Z"), or(neq(error,null), and(eq(feedback_key,"Correctness"), eq(feedback_score,0.0))))'
runs = fetch_runs("alpha-project", filter=fql)7οΈβ£ Get formatted messages for conversational AI (default: pretty format)
# Returns formatted messages focusing on human/AI/tool exchanges
result = fetch_runs("alpha-project", limit=10, format_type="pretty")
# result["formatted"] contains human-readable formatted messages
# result["messages"] contains the raw message list
# result["runs"] contains full run data8οΈβ£ Get messages in JSON format
result = fetch_runs("alpha-project", limit=10, format_type="json")
# result["messages"] contains messages as JSON array
# result["formatted"] contains pretty-printed JSON stringπ§ NOTES FOR AGENTS
Use this to query LangSmith data sources dynamically.
Compose FQL strings programmatically based on your intent.
Combine
filter,trace_filter, andtree_filterfor hierarchical logic.Always verify that
project_namematches an existing LangSmith project.Returned
dictobjects have fields like:id,name,run_type,inputs,outputs,error,start_time,end_time,latency,metadata,feedback, etc.If the trace is big, save it to a file (if you have this ability) and analyze it locally.
For conversational AI agents: Use
format_type="pretty"(default) to get human-readable message exchanges focusing on human/AI/tool messages rather than full trace details.
Inputs: project_name (required), trace_id, run_type, error, +8 more. Returns: object
get_prompt_by_nameA
Get a specific prompt by its exact name.
Args: prompt_name (str): The exact name of the prompt to retrieve ctx: FastMCP context (automatically provided)
Returns: Dict[str, Any]: Dictionary containing the prompt details and template, or an error message if the prompt cannot be found
Inputs: prompt_name (required). Returns: object
list_datasetsA
Fetch LangSmith datasets.
Note: If no arguments are provided, all datasets will be returned.
Args: dataset_ids (Optional[str]): Dataset IDs to filter by as JSON array string (e.g., '["id1", "id2"]') or single ID data_type (Optional[str]): Filter by dataset data type (e.g., 'chat', 'kv') dataset_name (Optional[str]): Filter by exact dataset name dataset_name_contains (Optional[str]): Filter by substring in dataset name metadata (Optional[str]): Filter by metadata as JSON object string (e.g., '{"key": "value"}') limit (int): Max number of datasets to return (default: 20) ctx: FastMCP context (automatically provided)
Returns: Dict[str, Any]: Dictionary containing the datasets and metadata, or an error message if the datasets cannot be retrieved
Inputs: dataset_ids, data_type, dataset_name, dataset_name_contains, +2 more. Returns: object
list_examplesA
Fetch examples from a LangSmith dataset with advanced filtering options.
Note: Either dataset_id, dataset_name, or example_ids must be provided. If multiple are provided, they are used in order of precedence: example_ids, dataset_id, dataset_name.
Args: dataset_id (Optional[str]): Dataset ID to retrieve examples from dataset_name (Optional[str]): Dataset name to retrieve examples from example_ids (Optional[str]): Specific example IDs as JSON array string (e.g., '["id1", "id2"]') or single ID limit (int): Maximum number of examples to return (default: 10) offset (int): Number of examples to skip (default: 0) filter (Optional[str]): Filter string using LangSmith query syntax (e.g., 'has(metadata, {"key": "value"})') metadata (Optional[str]): Metadata to filter by as JSON object string (e.g., '{"key": "value"}') splits (Optional[str]): Dataset splits as JSON array string (e.g., '["train", "test"]') or single split inline_s3_urls (Optional[str]): Whether to inline S3 URLs: "true" or "false" (default: SDK default if not specified) include_attachments (Optional[str]): Whether to include attachments: "true" or "false" (default: SDK default if not specified) as_of (Optional[str]): Dataset version tag OR ISO timestamp to retrieve examples as of that version/time ctx: FastMCP context (automatically provided)
Returns: Dict[str, Any]: Dictionary containing the examples and metadata, or an error message if the examples cannot be retrieved
Inputs: dataset_id, dataset_name, example_ids, filter, +7 more. Returns: object
list_experimentsA
List LangSmith experiment projects (reference projects) with mandatory dataset filtering.
Fetches experiment projects from LangSmith that are associated with a specific dataset. These are projects used for model evaluation and comparison. Requires either a dataset ID or dataset name to filter experiments.
π§© PURPOSE
This function provides a convenient way to list and explore LangSmith experiment projects. It supports:
Filtering experiments by reference dataset (mandatory)
Filtering projects by name (partial match)
Limiting the number of results
Automatically extracting deployment IDs from nested project data
Returns simplified project information with key metrics (latency, cost, feedback stats)
βοΈ PARAMETERS
reference_dataset_id : str, optional
The ID of the reference dataset to filter experiments by.
Either this OR reference_dataset_name must be provided (but not both).
reference_dataset_name : str, optional
The name of the reference dataset to filter experiments by.
Either this OR reference_dataset_id must be provided (but not both).
limit : int, default 5 Maximum number of experiments to return. This can be adjusted by agents or users based on their needs.
project_name : str, optional
Filter projects by name using partial matching. If provided, only projects
whose names contain this string will be returned.
Example: project_name="Chat" will match "Chat-LangChain", "ChatBot", etc.
π€ RETURNS
Dict[str, Any] A dictionary containing an "experiments" key with a list of simplified experiment project dictionaries:
```python
{
"experiments": [
{
"name": "Experiment-Chat-LangChain",
"experiment_id": "787d5165-f110-43ff-a3fb-66ea1a70c971",
"feedback_stats": {...}, # Feedback statistics if available
"latency_p50_seconds": 1.626, # 50th percentile latency in seconds
"latency_p99_seconds": 2.390, # 99th percentile latency in seconds
"total_cost": 0.00013005, # Total cost in dollars
"prompt_cost": 0.00002085, # Prompt cost in dollars
"completion_cost": 0.0001092, # Completion cost in dollars
"agent_deployment_id": "deployment-123" # Only if available
},
...
]
}
```π§ͺ EXAMPLES
1οΈβ£ List experiments for a dataset by ID
experiments = list_experiments(reference_dataset_id="f5ca13c6-96ad-48ba-a432-ebb6bf94528f")2οΈβ£ List experiments for a dataset by name
experiments = list_experiments(reference_dataset_name="my-dataset", limit=10)3οΈβ£ Find experiments with specific name pattern
experiments = list_experiments(
reference_dataset_id="f5ca13c6-96ad-48ba-a432-ebb6bf94528f",
project_name="Chat",
limit=1
)π§ NOTES FOR AGENTS
Returns simplified experiment information with key metrics (latency, cost, feedback stats)
The
agent_deployment_idfield is automatically extracted from nested project data when available, making it easy to identify agent deploymentsExperiments are filtered to include only reference projects (associated with datasets)
The function uses
name_containsfor filtering, so partial matches workYou must provide either
reference_dataset_idORreference_dataset_name, but not bothExperiment projects are used for model evaluation and comparison across different runs
Inputs: reference_dataset_id, reference_dataset_name, limit, project_name. Returns: object
list_projectsA
List LangSmith projects with optional filtering and detail level control.
Fetches projects from LangSmith, optionally filtering by name and controlling the level of detail returned. Can return either simplified project information or full project details. In case a dataset id or name is provided, you don't need to provide a project name.
π§© PURPOSE
This function provides a convenient way to list and explore LangSmith projects. It supports:
Filtering projects by name (partial match)
Limiting the number of results
Choosing between simplified or full project information
Automatically extracting deployment IDs from nested project data
βοΈ PARAMETERS
limit : int, default 5 Maximum number of projects to return (as string, e.g., "5"). This can be adjusted by agents or users based on their needs.
project_name : str, optional
Filter projects by name using partial matching. If provided, only projects
whose names contain this string will be returned.
Example: project_name="Chat" will match "Chat-LangChain", "ChatBot", etc.
more_info : str, default "false"
Controls the level of detail returned:
- "false" (default): Returns simplified project information with only
essential fields: name, project_id, and agent_deployment_id (if available)
- "true": Returns full project details as returned by the LangSmith API
reference_dataset_id : str, optional
The ID of the reference dataset to filter projects by.
Either this OR reference_dataset_name must be provided (but not both).
reference_dataset_name : str, optional
The name of the reference dataset to filter projects by.
Either this OR reference_dataset_id must be provided (but not both).
π€ RETURNS
List[dict]
A list of project dictionaries. The structure depends on more_info:
**When `more_info=False` (simplified):**
```python
[
{
"name": "Chat-LangChain",
"project_id": "787d5165-f110-43ff-a3fb-66ea1a70c971",
"agent_deployment_id": "deployment-123" # Only if available
},
...
]
```
**When `more_info=True` (full details):**
Returns complete project objects with all fields from the LangSmith API,
including metadata, settings, statistics, and nested structures.π§ͺ EXAMPLES
1οΈβ£ List first 5 projects (simplified)
projects = list_projects(limit="5")2οΈβ£ Search for projects with "Chat" in the name
projects = list_projects(project_name="Chat", limit="10")3οΈβ£ Get full project details
projects = list_projects(limit="3", more_info="true")4οΈβ£ Find a specific project with full details
projects = list_projects(project_name="MyProject", more_info="true", limit="1")π§ NOTES FOR AGENTS
Use
more_info="false"for quick project discovery and listingUse
more_info="true"when you need detailed project informationThe
agent_deployment_idfield is automatically extracted from nested project data when available, making it easy to identify agent deploymentsProjects are filtered to exclude reference projects by default
The function uses
name_containsfor filtering, so partial matches work
Inputs: limit, project_name, more_info, reference_dataset_id, +1 more. Returns: object
list_promptsB
Fetch prompts from LangSmith with optional filtering.
Args: is_public (str): Filter by prompt visibility - "true" for public prompts, "false" for private prompts (default: "false") limit (int): Maximum number of prompts to return (default: 20)
Returns: Dict[str, Any]: Dictionary containing the prompts and metadata
Inputs: is_public, limit. Returns: object
push_promptC
Call this tool when you need to understand how to create and push prompts to LangSmith.
Inputs: no named parameters. Returns: result
read_datasetA
Read a specific dataset from LangSmith.
Note: Either dataset_id or dataset_name must be provided to identify the dataset. If both are provided, dataset_id takes precedence.
Args: dataset_id (Optional[str]): Dataset ID to retrieve dataset_name (Optional[str]): Dataset name to retrieve ctx: FastMCP context (automatically provided)
Returns: Dict[str, Any]: Dictionary containing the dataset details, or an error message if the dataset cannot be retrieved
Example in case you need to create a separate python script to read a dataset: ```python from langsmith import Client
client = Client()
dataset = client.read_dataset(dataset_name="My Dataset")
# Or by ID:
# dataset = client.read_dataset(dataset_id="dataset-id-here")
```Inputs: dataset_id, dataset_name. Returns: object
read_exampleA
Read a specific example from LangSmith.
Args: example_id (str): Example ID to retrieve as_of (Optional[str]): Dataset version tag OR ISO timestamp to retrieve the example as of that version/time ctx: FastMCP context (automatically provided)
Returns: Dict[str, Any]: Dictionary containing the example details, or an error message if the example cannot be retrieved
Example in case you need to create a separate python script to read an example: ```python from langsmith import Client
client = Client()
example = client.read_example(example_id="example-id-here")
# Or with version:
# example = client.read_example(example_id="example-id-here", as_of="v1.0")
```Inputs: example_id (required), as_of. Returns: object
run_experimentC
Call this tool when you need to understand how to run experiments and evaluations in LangSmith.
Inputs: no named parameters. Returns: result
update_examplesC
Call this tool when you need to understand how to update dataset examples in LangSmith.
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 13 tools
Most tools have distinct purposes targeting different LangSmith resources like datasets, examples, prompts, runs, projects, and experiments, with clear boundaries. However, 'create_dataset' and 'push_prompt' are described as informational tools ('call this tool when you need to understand how to...'), which could confuse agents about their actual functionality versus other tools that perform operations directly.
Tool names follow a highly consistent verb_noun pattern throughout, such as 'create_dataset', 'fetch_runs', 'list_datasets', 'read_example', and 'update_examples'. All tools use snake_case with clear, descriptive names, making the set predictable and easy to navigate.
With 13 tools, the server is well-scoped for managing LangSmith resources, covering datasets, examples, prompts, runs, projects, and experiments. Each tool serves a specific function without redundancy, and the count aligns with the complexity of the domain, providing comprehensive coverage without being overwhelming.
The tool set offers strong coverage for core LangSmith operations, including CRUD-like actions for datasets, examples, prompts, runs, projects, and experiments. Minor gaps exist, such as no explicit 'delete' tools for resources like datasets or prompts, but agents can likely work around this given the overall robust surface for analytics and management tasks.
Maintenance
Related MCP Connectors
Lets AI agents analyze API metrics, request logs, and traces, and manage apps and alerts.
Query your AI agent traces, root-cause verdicts and issues, and run investigations, from your agent.
Gives AI agents direct access to your Sanity projects and guidance for working with them
Connect assistants to your workspace knowledge, skills, and work tools.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables read-only querying of LangSmith traces including runs, children, and URLs without extra instrumentation.51-
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to access observability and evaluation data, including run history, span traces, LLM-as-judge evaluation results, and regression reports.MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI agents and MCP clients to debug and observe LLM applications by querying traces, sessions, exceptions, prompts, datasets, scores, and metrics. Supports local stdio/HTTP access, selective tool loading, and read-only operation for safer observability workflows.-
- FlicenseNot gradedqualityAmaintenanceEnables AI agents and coding assistants to query trace, session, exception, routing, prompt, dataset, score, and metric data from a Langfuse instance for debugging and observability. Offers selective tool-group loading and a read-only mode to control token overhead and write access.-