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

Method runMetaDescribe

app/src/AI/Conversation.cpp:757–787  ·  view source on GitHub ↗

* @brief meta.describeCommand handler: returns command schema or not_found. */

Source from the content-addressed store, hash-verified

755 * @brief meta.describeCommand handler: returns command schema or not_found.
756 */
757void AI::Conversation::runMetaDescribe(const QString& callId,
758 const QString& name,
759 const QJsonObject& arguments)
760{
761 appendToolCallCard(callId, name, arguments, CallStatus::Running);
762 const auto target = arguments.value(QStringLiteral("name")).toString();
763 QJsonObject reply;
764 if (target.isEmpty()) {
765 reply[QStringLiteral("ok")] = false;
766 reply[QStringLiteral("error")] = QStringLiteral("missing_name");
767 } else {
768 const auto desc = m_dispatcher->describeCommand(target);
769 if (desc.isEmpty()) {
770 reply[QStringLiteral("ok")] = false;
771 reply[QStringLiteral("error")] = QStringLiteral("not_found");
772 reply[QStringLiteral("name")] = target;
773 } else {
774 reply[QStringLiteral("ok")] = true;
775 reply[QStringLiteral("command")] = desc;
776 const auto skill = skillForCommand(target);
777 if (!skill.isEmpty())
778 reply[QStringLiteral("loadSkillFirst")] = skill;
779 }
780 }
781 recordToolResult(callId, name, reply);
782 updateToolCallCard(callId,
783 reply.value(QStringLiteral("ok")).toBool() ? CallStatus::Done
784 : CallStatus::Error,
785 reply);
786 releaseOutstandingToolResult();
787}
788
789/**
790 * @brief meta.fetchScriptingDocs handler: returns the canonical doc body for a kind.

Callers

nothing calls this directly

Calls 4

skillForCommandFunction · 0.85
isEmptyMethod · 0.80
describeCommandMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected