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