isToolMessage
Type guard narrowing a Message to role: 'tool' (a tool result turn).
import { isToolMessage } from '@threadplane/chat';Declaration · overload 1
Parameters
m· requiredMessageThe message to test.
Returns
m is Message & {
role: 'tool';
}true (and narrows m) when the message is a tool result.
Examples
if (isToolMessage(m)) console.log(m.toolCallId);