MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / isToolCallPart

Function isToolCallPart

agents/e2e/context-pruner.e2e.test.ts:19–28  ·  view source on GitHub ↗

* Type guard to check if a content part is a tool-call part with toolCallId.

(part: unknown)

Source from the content-addressed store, hash-verified

17 * Type guard to check if a content part is a tool-call part with toolCallId.
18 */
19function isToolCallPart(part: unknown): part is ToolCallPart {
20 return (
21 typeof part === 'object' &&
22 part !== null &&
23 'type' in part &&
24 part.type === 'tool-call' &&
25 'toolCallId' in part &&
26 typeof (part as ToolCallPart).toolCallId === 'string'
27 )
28}
29
30/**
31 * Type guard to check if a message is a tool message with toolCallId.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected