MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / makeToolUseBlock

Function makeToolUseBlock

app/src/AI/Conversation.cpp:457–472  ·  view source on GitHub ↗

* @brief Builds the history tool_use block, folding provider extras (underscore-prefixed * passthrough fields such as Gemini thought signatures) into it. */

Source from the content-addressed store, hash-verified

455 * passthrough fields such as Gemini thought signatures) into it.
456 */
457static QJsonObject makeToolUseBlock(const QString& callId,
458 const QString& name,
459 const QJsonObject& arguments,
460 const QJsonObject& extras)
461{
462 QJsonObject block;
463 block[QStringLiteral("type")] = QStringLiteral("tool_use");
464 block[QStringLiteral("id")] = callId;
465 block[QStringLiteral("name")] = name;
466 block[QStringLiteral("input")] = arguments;
467 for (auto it = extras.constBegin(); it != extras.constEnd(); ++it)
468 if (it.key().startsWith(QLatin1Char('_')))
469 block[it.key()] = it.value();
470
471 return block;
472}
473
474/**
475 * @brief Records a tool-use request and dispatches per safety tag.

Callers 1

onToolCallRequestedMethod · 0.85

Calls 2

keyMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected