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

Function skillsResult

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

Source from the content-addressed store, hash-verified

785// sees the artifact skills, so the index cannot advertise a how-to for tools it
786// does not have, and fetching one by name misses like any unknown skill.
787const skillsResult = (
788 name: string | undefined,
789 executeInventory: string,
790 catalog: readonly Skill[],
791): McpToolResult => {
792 const trimmed = name?.trim();
793 if (!trimmed) {
794 return { content: [{ type: "text", text: renderSkillsIndex(catalog) }] };
795 }
796 const skill = findSkill(trimmed, catalog);
797 if (!skill) {
798 return {
799 content: [
800 { type: "text", text: `No skill named "${trimmed}".\n\n${renderSkillsIndex(catalog)}` },
801 ],
802 isError: true,
803 };
804 }
805 const text =
806 skill.name === EXECUTE_SKILL.name && executeInventory.length > 0
807 ? `${skill.body}\n\n${executeInventory}`
808 : skill.body;
809 return { content: [{ type: "text", text }] };
810};
811
812/** Pull the live integration inventory block out of the built execute
813 * 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