MCPcopy Create free account
hub / github.com/modelcontextprotocol/mcpb / promptTools

Function promptTools

src/cli/init.ts:222–262  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

220}
221
222export 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
264export async function promptPrompts() {
265 const addPrompts = await confirm({

Callers 1

initExtensionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…