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

Function skillsResult

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

Source from the content-addressed store, hash-verified

801// sees the artifact skills, so the index cannot advertise a how-to for tools it
802// does not have, and fetching one by name misses like any unknown skill.
803const skillsResult = (
804 name: string | undefined,
805 executeInventory: string,
806 catalog: readonly Skill[],
807): McpToolResult => {
808 const trimmed = name?.trim();
809 if (!trimmed) {
810 return { content: [{ type: "text", text: renderSkillsIndex(catalog) }] };
811 }
812 const skill = findSkill(trimmed, catalog);
813 if (!skill) {
814 return {
815 content: [
816 {
817 type: "text",
818 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)}`,
819 },
820 ],
821 isError: true,
822 };
823 }
824 const text =
825 skill.name === EXECUTE_SKILL.name && executeInventory.length > 0
826 ? `${skill.body}\n\n${executeInventory}`
827 : skill.body;
828 return { content: [{ type: "text", text }] };
829};
830
831/** Pull the live integration inventory block out of the built execute
832 * 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