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

Function skillsResult

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

Source from the content-addressed store, hash-verified

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