( name: string | undefined, executeInventory: string, catalog: readonly Skill[], )
| 764 | // sees the artifact skills, so the index cannot advertise a how-to for tools it |
| 765 | // does not have, and fetching one by name misses like any unknown skill. |
| 766 | const skillsResult = ( |
| 767 | name: string | undefined, |
| 768 | executeInventory: string, |
| 769 | catalog: readonly Skill[], |
| 770 | ): McpToolResult => { |
| 771 | const trimmed = name?.trim(); |
| 772 | if (!trimmed) { |
| 773 | return { content: [{ type: "text", text: renderSkillsIndex(catalog) }] }; |
| 774 | } |
| 775 | const skill = findSkill(trimmed, catalog); |
| 776 | if (!skill) { |
| 777 | return { |
| 778 | content: [ |
| 779 | { type: "text", text: `No skill named "${trimmed}".\n\n${renderSkillsIndex(catalog)}` }, |
| 780 | ], |
| 781 | isError: true, |
| 782 | }; |
| 783 | } |
| 784 | const text = |
| 785 | skill.name === EXECUTE_SKILL.name && executeInventory.length > 0 |
| 786 | ? `${skill.body}\n\n${executeInventory}` |
| 787 | : skill.body; |
| 788 | return { content: [{ type: "text", text }] }; |
| 789 | }; |
| 790 | |
| 791 | /** Pull the live integration inventory block out of the built execute |
| 792 | * description (it runs from its header to the end), so the `skills` tool can |
no test coverage detected