()
| 220 | } |
| 221 | |
| 222 | export async function promptTools() { |
| 223 | const addTools = await confirm({ |
| 224 | message: |
| 225 | "Does your MCP Server provide tools you want to advertise (optional)?", |
| 226 | default: true, |
| 227 | }); |
| 228 | |
| 229 | const tools: Array<{ name: string; description?: string }> = []; |
| 230 | let toolsGenerated = false; |
| 231 | |
| 232 | if (addTools) { |
| 233 | let addMore = true; |
| 234 | while (addMore) { |
| 235 | const toolName = await input({ |
| 236 | message: "Tool name:", |
| 237 | validate: (value) => value.trim().length > 0 || "Tool name is required", |
| 238 | }); |
| 239 | const toolDescription = await input({ |
| 240 | message: "Tool description (optional):", |
| 241 | }); |
| 242 | |
| 243 | tools.push({ |
| 244 | name: toolName, |
| 245 | ...(toolDescription ? { description: toolDescription } : {}), |
| 246 | }); |
| 247 | |
| 248 | addMore = await confirm({ |
| 249 | message: "Add another tool?", |
| 250 | default: false, |
| 251 | }); |
| 252 | } |
| 253 | |
| 254 | // Ask about generated tools |
| 255 | toolsGenerated = await confirm({ |
| 256 | message: "Does your server generate additional tools at runtime?", |
| 257 | default: false, |
| 258 | }); |
| 259 | } |
| 260 | |
| 261 | return { tools, toolsGenerated }; |
| 262 | } |
| 263 | |
| 264 | export async function promptPrompts() { |
| 265 | const addPrompts = await confirm({ |
no outgoing calls
no test coverage detected
searching dependent graphs…