MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / skillsResult

Function skillsResult

packages/hosts/mcp/src/tool-server.ts:766–789  ·  view source on GitHub ↗
(
  name: string | undefined,
  executeInventory: string,
  catalog: readonly Skill[],
)

Source from the content-addressed store, hash-verified

764// sees the artifact skills, so the index cannot advertise a how-to for tools it
765// does not have, and fetching one by name misses like any unknown skill.
766const skillsResult = (
767 name: string | undefined,
768 executeInventory: string,
769 catalog: readonly Skill[],
770): McpToolResult => {
771 const trimmed = name?.trim();
772 if (!trimmed) {
773 return { content: [{ type: "text", text: renderSkillsIndex(catalog) }] };
774 }
775 const skill = findSkill(trimmed, catalog);
776 if (!skill) {
777 return {
778 content: [
779 { type: "text", text: `No skill named "${trimmed}".\n\n${renderSkillsIndex(catalog)}` },
780 ],
781 isError: true,
782 };
783 }
784 const text =
785 skill.name === EXECUTE_SKILL.name && executeInventory.length > 0
786 ? `${skill.body}\n\n${executeInventory}`
787 : skill.body;
788 return { content: [{ type: "text", text }] };
789};
790
791/** Pull the live integration inventory block out of the built execute
792 * description (it runs from its header to the end), so the `skills` tool can

Callers 1

createExecutorMcpServerFunction · 0.85

Calls 2

renderSkillsIndexFunction · 0.90
findSkillFunction · 0.90

Tested by

no test coverage detected