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

Function skillsResult

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

Source from the content-addressed store, hash-verified

790// sees the artifact skills, so the index cannot advertise a how-to for tools it
791// does not have, and fetching one by name misses like any unknown skill.
792const skillsResult = (
793 name: string | undefined,
794 executeInventory: string,
795 catalog: readonly Skill[],
796): McpToolResult => {
797 const trimmed = name?.trim();
798 if (!trimmed) {
799 return { content: [{ type: "text", text: renderSkillsIndex(catalog) }] };
800 }
801 const skill = findSkill(trimmed, catalog);
802 if (!skill) {
803 return {
804 content: [
805 {
806 type: "text",
807 text: `No skill named "${trimmed}". This tool serves only Executor's own docs, listed below — a skill from your harness or the user's project is not reachable from here.\n\n${renderSkillsIndex(catalog)}`,
808 },
809 ],
810 isError: true,
811 };
812 }
813 const text =
814 skill.name === EXECUTE_SKILL.name && executeInventory.length > 0
815 ? `${skill.body}\n\n${executeInventory}`
816 : skill.body;
817 return { content: [{ type: "text", text }] };
818};
819
820/** Pull the live integration inventory block out of the built execute
821 * 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