get_thread_history

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...

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

What get_thread_history does on Langsmith

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.

ParameterTypeRequiredDescription
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.

Why get_thread_history needs a policy

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.

Questions about get_thread_history

What does the get_thread_history tool do? +

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.

What parameters does get_thread_history accept? +

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.

How do I enforce a policy on get_thread_history? +

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.

What risk level is get_thread_history? +

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

Can I rate-limit get_thread_history? +

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.

How do I block get_thread_history completely? +

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.

What MCP server provides get_thread_history? +

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.

// 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.