MCPcopy Create free account
hub / github.com/freecodexyz/free-code / contentHasToolReference

Function contentHasToolReference

src/utils/messages.ts:1778–1787  ·  view source on GitHub ↗

* Does the content array have a tool_result block whose inner content * contains tool_reference (ToolSearch loaded tools)?

(
  content: ReadonlyArray<ContentBlockParam>,
)

Source from the content-addressed store, hash-verified

1776 * contains tool_reference (ToolSearch loaded tools)?
1777 */
1778function contentHasToolReference(
1779 content: ReadonlyArray<ContentBlockParam>,
1780): boolean {
1781 return content.some(
1782 block =>
1783 block.type === 'tool_result' &&
1784 Array.isArray(block.content) &&
1785 block.content.some(isToolReferenceBlock),
1786 )
1787}
1788
1789/**
1790 * Ensure all text content in attachment-origin messages carries the

Callers 2

normalizeMessagesForAPIFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected