( name: string | undefined, executeInventory: string, catalog: readonly Skill[], )
| 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. |
| 816 | const 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 |
no test coverage detected