MCPcopy Create free account
hub / github.com/Palm1r/QodeAssist / executeAsync

Method executeAsync

tools/SkillTool.cpp:57–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57QFuture<LLMQore::ToolResult> SkillTool::executeAsync(const QJsonObject &input)
58{
59 const QString name = input["name"].toString().trimmed();
60
61 const std::optional<Skills::AgentSkill> found
62 = m_skillsManager ? m_skillsManager->findByName(name) : std::nullopt;
63
64 return QtConcurrent::run([name, found]() -> LLMQore::ToolResult {
65 if (name.isEmpty()) {
66 throw LLMQore::ToolInvalidArgument(
67 "'name' parameter is required and cannot be empty");
68 }
69 if (!found) {
70 throw LLMQore::ToolRuntimeError(
71 QString("Unknown skill: '%1'. Use a skill name from the Available Skills "
72 "catalog in the system prompt.")
73 .arg(name));
74 }
75 if (found->body.isEmpty()) {
76 throw LLMQore::ToolRuntimeError(
77 QString("Skill '%1' has no instructions.").arg(found->name));
78 }
79
80 return LLMQore::ToolResult::text(
81 QString("Skill: %1\n\n%2").arg(found->name, found->body));
82 });
83}
84
85} // namespace QodeAssist::Tools

Callers

nothing calls this directly

Calls 5

ToolInvalidArgumentClass · 0.85
ToolRuntimeErrorClass · 0.85
findByNameMethod · 0.80
toStringMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected