(name: string | undefined, executeInventory: string)
| 621 | // same block the execute tool description carries, so a model reading the guide |
| 622 | // sees what is connected without a second round trip. |
| 623 | const skillsResult = (name: string | undefined, executeInventory: string): McpToolResult => { |
| 624 | const trimmed = name?.trim(); |
| 625 | if (!trimmed) { |
| 626 | return { content: [{ type: "text", text: renderSkillsIndex() }] }; |
| 627 | } |
| 628 | const skill = findSkill(trimmed); |
| 629 | if (!skill) { |
| 630 | return { |
| 631 | content: [{ type: "text", text: `No skill named "${trimmed}".\n\n${renderSkillsIndex()}` }], |
| 632 | isError: true, |
| 633 | }; |
| 634 | } |
| 635 | const text = |
| 636 | skill.name === EXECUTE_SKILL.name && executeInventory.length > 0 |
| 637 | ? `${skill.body}\n\n${executeInventory}` |
| 638 | : skill.body; |
| 639 | return { content: [{ type: "text", text }] }; |
| 640 | }; |
| 641 | |
| 642 | /** Pull the live integration inventory block out of the built execute |
| 643 | * description (it runs from its header to the end), so the `skills` tool can |
no test coverage detected