( name: string | undefined, executeInventory: string, catalog: readonly Skill[], )
| 940 | // sees the artifact skills, so the index cannot advertise a how-to for tools it |
| 941 | // does not have, and fetching one by name misses like any unknown skill. |
| 942 | const skillsResult = ( |
| 943 | name: string | undefined, |
| 944 | executeInventory: string, |
| 945 | catalog: readonly Skill[], |
| 946 | ): McpToolResult => { |
| 947 | const trimmed = name?.trim(); |
| 948 | if (!trimmed) { |
| 949 | return { content: [{ type: "text", text: renderSkillsIndex(catalog) }] }; |
| 950 | } |
| 951 | const skill = findSkill(trimmed, catalog); |
| 952 | if (!skill) { |
| 953 | return { |
| 954 | content: [ |
| 955 | { |
| 956 | type: "text", |
| 957 | 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)}`, |
| 958 | }, |
| 959 | ], |
| 960 | isError: true, |
| 961 | }; |
| 962 | } |
| 963 | const text = |
| 964 | skill.name === EXECUTE_SKILL.name && executeInventory.length > 0 |
| 965 | ? `${skill.body}\n\n${executeInventory}` |
| 966 | : skill.body; |
| 967 | return { content: [{ type: "text", text }] }; |
| 968 | }; |
| 969 | |
| 970 | /** Pull the live integration inventory block out of the built execute |
| 971 | * description (it runs from its header to the end), so the `skills` tool can |
no test coverage detected