MCPcopy Create free account
hub / github.com/Noumena-Network/code / isToolResultBlockWithContent

Function isToolResultBlockWithContent

src/utils/toolSearch.ts:515–524  ·  view source on GitHub ↗

* Type guard for tool_result blocks with array content.

(obj: unknown)

Source from the content-addressed store, hash-verified

513 * Type guard for tool_result blocks with array content.
514 */
515function isToolResultBlockWithContent(obj: unknown): obj is ToolResultBlock {
516 return (
517 typeof obj === 'object' &&
518 obj !== null &&
519 'type' in obj &&
520 (obj as { type: unknown }).type === 'tool_result' &&
521 'content' in obj &&
522 Array.isArray((obj as { content: unknown }).content)
523 )
524}
525
526/**
527 * Extract tool names from tool_reference blocks in message history.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected