MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / addToolBlock

Function addToolBlock

src/stores/aiChat.ts:767–775  ·  view source on GitHub ↗
(toolName: string, params?: Record<string, unknown>, toolCallId?: string)

Source from the content-addressed store, hash-verified

765 }
766
767 const addToolBlock = (toolName: string, params?: Record<string, unknown>, toolCallId?: string) => {
768 const idx = getAiMessageIndex()
769 const blocks = targetBuffer.messages[idx].contentBlocks || []
770 blocks.push({
771 type: 'tool',
772 tool: { name: toolName, displayName: toolName, status: 'running', params, toolCallId },
773 })
774 updateAIMessage({ contentBlocks: [...blocks] })
775 }
776
777 const addRenderOnlyToolPendingBlock = (toolName: string, params?: Record<string, unknown>, toolCallId?: string) => {
778 const pendingBlock = createRenderOnlyToolPendingBlock(toolName, params, toolCallId)

Callers 2

sendMessageFunction · 0.85
editCurrentRoundOnlyFunction · 0.85

Calls 1

updateAIMessageFunction · 0.85

Tested by

no test coverage detected