Skip to main content
Glama

get_thread_history

Retrieve paginated message history for a conversation thread by specifying thread ID, project name, and page number. Use character-based pagination to control response size and preview long strings.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
thread_idYesThe unique ID of the thread to fetch history for
page_numberYes1-based page index (required)
project_nameYesThe name of the project containing the thread
preview_charsNoTruncate long strings to this length
max_chars_per_pageNoMax character count per page, capped at 30000
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It explains the char-based pagination algorithm, the truncation of long strings via preview_chars, and the cap on max_chars_per_page at 30000. These are meaningful details beyond a simple 'returns messages' and give the agent a clear picture of how the tool behaves, though it does not explicitly state read-only status or error conditions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a one-sentence summary, a focused explanation of pagination, and clearly labeled Args/Returns sections. It is appropriately sized for the tool's complexity, front-loads the main purpose, and avoids unnecessary verbiage.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description includes a Returns section detailing the response shape (result, page_number, total_pages). It also covers the pagination contract and parameter constraints, making it sufficient for an agent to call the tool correctly. Minor gaps remain for error cases, but the essentials are present.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description adds value by explaining the 'character budget' concept that ties max_chars_per_page to page construction, and clarifies the truncation behavior of preview_chars. This gives the agent a deeper understanding than the schema's basic field descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a clear, specific statement of what the tool does: 'Retrieve one page of message history for a specific conversation thread.' This uses a specific verb ('retrieve'), defines the resource ('message history'), and notes the single-page scope, which distinguishes it from sibling tools like list_prompts or fetch_runs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit pagination guidance—'Supply page_number (1-based) on every call; use the returned total_pages to request further pages'—which communicates the intended usage pattern. However, it does not explicitly mention when to avoid this tool or suggest alternatives, though the context implies it is the appropriate tool for fetching thread history.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/amitrechavia/langsmith-mcp-server-js'

If you have feedback or need assistance with the MCP directory API, please join our Discord server