Skip to content

ai_assistant_tool_result_max_chars

github-actions[bot] edited this page Nov 14, 2026 · 6 revisions

Filters the maximum serialized size for one tool result sent to an LLM provider or saved in conversation history.

Oversized tool results are deterministically compacted and may be reopened from the active session cache with inspect_tool_result.

Auto-generated Example

add_filter(
   'ai_assistant_tool_result_max_chars',
    function( int $chars ) {
        // Your code here.
        return $chars;
    }
);

Parameters

  • int $chars Maximum serialized tool result size in characters. Default 32768.

Files

apply_filters('ai_assistant_tool_result_max_chars', 32 * 1024)

← All Hooks

Clone this wiki locally