Retrieve one page of message history for a specific conversation thread. Uses char-based pagination: pages are built by character budget (max_chars_per_page). Long strings are truncated to preview_chars. Supply page_number (1-based) on every call; use the returned total_pages to request further p...
AI agents call get_thread_history 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
thread_id | string | Yes | The unique ID of the thread to fetch history for |
page_number | number | Yes | 1-based page index (required) |
project_name | string | Yes | The name of the project containing the thread |
preview_chars | number | — | Truncate long strings to this length |
max_chars_per_page | number | — | Max character count per page, capped at 30000 |
Parameters from the server's own tool schema.
This tool performs data retrieval with no side effects. It fetches historical conversation data from a specific thread using read-only parameters (thread_id, project_name, page_number). No data is created, modified, deleted, executed, or monetarily committed. The pagination and truncation logic are purely for presentation of existing data.
From the tool's definition Tool retrieves message history for a conversation thread with pagination. Uses parameters like thread_id, project_name, and page_number to query and return data. Description emphasizes 'Retrieve' and uses pagination mechanics typical of read-only operations.
Attacks that exploit this kind of access
Retrieve one page of message history for a specific conversation thread. Uses char-based pagination: pages are built by character budget (max_chars_per_page). Long strings are truncated to preview_chars. Supply page_number (1-based) on every call; use the returned total_pages to request further pages. Args: thread_id (str): The unique ID of the thread to fetch history for project_name (str): The name of the project containing the thread page_number (int): 1-based page index (required) max_chars_per_page (int): Max character count per page, capped at 30000 (default: 25000) preview_chars (int): Truncate long strings to this length (default: 150) Returns: Dict with result (list of messages), page_number, total_pages, etc. It is categorised as a Read tool in the Langsmith MCP Server, which means it retrieves data without modifying state.
get_thread_history accepts 5 parameters: thread_id, page_number, project_name, preview_chars, max_chars_per_page. Required: thread_id, page_number, project_name. The full parameter table on this page comes from the server's own tool schema.
Register the Langsmith MCP server in PolicyLayer and add a rule for get_thread_history: 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.
get_thread_history is a Read tool with low risk. Read-only tools are generally safe to allow by default.
Yes. Add a rate_limit block to the get_thread_history 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.
Set action: deny in the PolicyLayer policy for get_thread_history. 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.
get_thread_history 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.
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 →