fetch_runs

Fetch LangSmith runs from one or more projects with flexible filters and automatic pagination. All results are paginated by character budget to keep responses manageable. Use page_number and total_pages from the response to iterate through multiple pages. Args: project_name (str): The project nam...

Server Langsmith langsmith-mcp-server
Category Read
Risk class Low
Parameters 122 required

What fetch_runs does on Langsmith

AI agents call fetch_runs to retrieve information from Langsmith without modifying anything — typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.

ParameterTypeRequiredDescription
error string "true" for errored runs, "false" for successful
limit number Yes Maximum number of runs to fetch from LangSmith API (capped at 100)
filter string Filter Query Language (FQL) expression
is_root string "true" for only top-level traces
order_by string Sort field; prefix with '-' for descending
run_type string Filter by type: "llm", "chain", "tool", "retriever"
trace_id string Return only runs belonging to this trace UUID
page_number number 1-based page index
tree_filter string Filter applied to any run in the trace tree
project_name string Yes The project name to fetch runs from
trace_filter string Filter applied to the root run in each trace tree
preview_chars number Truncate long strings to this length

Parameters from the server's own tool schema.

Why fetch_runs needs a policy

This tool performs read-only operations on LangSmith run data. It retrieves runs based on filters but does not create, modify, delete, or execute any operations. The blast radius of misuse is minimal—an attacker could only access run data that the authenticated user has permission to view, with no ability to alter system state or trigger external operations.

From the tool's definition The tool 'fetch_runs' is designed to "Fetch LangSmith runs from one or more projects with flexible filters and automatic pagination." The description explicitly indicates retrieval of data with no modification or execution.

Risk signalsHigh parameter count (14 properties) · Admin/system-level operation

Questions about fetch_runs

What does the fetch_runs tool do? +

Fetch LangSmith runs from one or more projects with flexible filters and automatic pagination. All results are paginated by character budget to keep responses manageable. Use page_number and total_pages from the response to iterate through multiple pages. Args: project_name (str): The project name. For multiple projects, use JSON array string. limit (int): Max runs to fetch from LangSmith API (capped at 100). These runs are then paginated by character budget into pages. page_number (int): 1-based page index. Use with total_pages from response to iterate through pages. trace_id (str, optional): Return only runs that belong to this trace. run_type (str, optional): Filter by type: "llm", "chain", "tool", "retriever". error (str, optional): "true" for errored runs, "false" for successful. is_root (str, optional): "true" for only top-level traces. filter (str, optional): Filter Query Language (FQL) expression. trace_filter (str, optional): Filter applied to the root run. tree_filter (str, optional): Filter applied to any run in the trace tree. order_by (str, optional): Sort field; prefix with "-" for descending. Default "-start_time". reference_example_id (str, optional): Filter runs by reference example ID. max_chars_per_page (int): Max chars per page, capped at 30000. Default 25000. preview_chars (int): Truncate long strings to this length. Default 150. It is categorised as a Read tool in the Langsmith MCP Server, which means it retrieves data without modifying state.

What parameters does fetch_runs accept? +

fetch_runs accepts 12 parameters: error, limit, filter, is_root, order_by, run_type, trace_id, page_number, tree_filter, project_name, trace_filter, preview_chars. Required: limit, project_name. The full parameter table on this page comes from the server's own tool schema.

How do I enforce a policy on fetch_runs? +

Register the Langsmith MCP server in PolicyLayer and add a rule for fetch_runs: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Langsmith. Nothing to install.

What risk level is fetch_runs? +

fetch_runs is a Read tool with low risk. Read-only tools are generally safe to allow by default.

Can I rate-limit fetch_runs? +

Yes. Add a rate_limit block to the fetch_runs rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.

How do I block fetch_runs completely? +

Set action: deny in the PolicyLayer policy for fetch_runs. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.

What MCP server provides fetch_runs? +

fetch_runs is provided by the Langsmith MCP server (langsmith-mcp-server). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.

// LOOK UP ANOTHER SERVER

Every MCP server has a record like this.

Type a name, get the same breakdown: verified identity, auth posture, risk grade, capabilities, recommended policy.

Teams ship this data inside their own products. See what a licence covers →

// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.