@mcpc-tech/cli 0.1.35 → 0.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/mcpc.cjs +18 -7
- package/bin/mcpc.mjs +18 -7
- package/package.json +1 -1
package/bin/mcpc.cjs
CHANGED
|
@@ -9416,7 +9416,7 @@ IMPORTANT: You MUST respond with valid JSON only. Do not include any text before
|
|
|
9416
9416
|
let enhanced = systemPrompt || "";
|
|
9417
9417
|
const toolsPrompt = `
|
|
9418
9418
|
|
|
9419
|
-
|
|
9419
|
+
<available_tools>
|
|
9420
9420
|
You have access to the following tools. To use a tool, respond with this XML format:
|
|
9421
9421
|
<use_tool tool="tool_name">
|
|
9422
9422
|
{"param1": "value1", "param2": "value2"}
|
|
@@ -9425,23 +9425,34 @@ You have access to the following tools. To use a tool, respond with this XML for
|
|
|
9425
9425
|
Follow the JSON schema definition for each tool's parameters.
|
|
9426
9426
|
You can use multiple tools in one response. DO NOT include text before or after tool calls - wait for the tool results first.
|
|
9427
9427
|
|
|
9428
|
-
|
|
9428
|
+
<tools>`;
|
|
9429
9429
|
const toolDescriptions = tools.map((tool2) => {
|
|
9430
9430
|
if (tool2.type === "function") {
|
|
9431
9431
|
const toolAny = tool2;
|
|
9432
9432
|
const description = toolAny.description || "No description provided";
|
|
9433
9433
|
const schema = toolAny.inputSchema || toolAny.parameters;
|
|
9434
|
-
const
|
|
9435
|
-
|
|
9434
|
+
const schemaStr = schema ? `
|
|
9435
|
+
<schema>
|
|
9436
|
+
${JSON.stringify(schema, null, 2)}
|
|
9437
|
+
</schema>` : "";
|
|
9436
9438
|
return `
|
|
9437
|
-
|
|
9439
|
+
<tool name="${tool2.name}">
|
|
9440
|
+
<description>
|
|
9441
|
+
${description}
|
|
9442
|
+
</description>${schemaStr}
|
|
9443
|
+
</tool>`;
|
|
9438
9444
|
} else if (tool2.type === "provider-defined") {
|
|
9439
9445
|
return `
|
|
9440
|
-
|
|
9446
|
+
<tool name="${tool2.name}">
|
|
9447
|
+
<description>${tool2.id || "No description provided"}</description>
|
|
9448
|
+
</tool>`;
|
|
9441
9449
|
}
|
|
9442
9450
|
return "";
|
|
9443
9451
|
}).filter(Boolean).join("");
|
|
9444
|
-
|
|
9452
|
+
const toolsEnd = `
|
|
9453
|
+
</tools>
|
|
9454
|
+
</available_tools>`;
|
|
9455
|
+
enhanced = enhanced ? `${enhanced}${toolsPrompt}${toolDescriptions}${toolsEnd}` : `${toolsPrompt}${toolDescriptions}${toolsEnd}`.trim();
|
|
9445
9456
|
return enhanced || void 0;
|
|
9446
9457
|
}
|
|
9447
9458
|
/**
|
package/bin/mcpc.mjs
CHANGED
|
@@ -9424,7 +9424,7 @@ IMPORTANT: You MUST respond with valid JSON only. Do not include any text before
|
|
|
9424
9424
|
let enhanced = systemPrompt || "";
|
|
9425
9425
|
const toolsPrompt = `
|
|
9426
9426
|
|
|
9427
|
-
|
|
9427
|
+
<available_tools>
|
|
9428
9428
|
You have access to the following tools. To use a tool, respond with this XML format:
|
|
9429
9429
|
<use_tool tool="tool_name">
|
|
9430
9430
|
{"param1": "value1", "param2": "value2"}
|
|
@@ -9433,23 +9433,34 @@ You have access to the following tools. To use a tool, respond with this XML for
|
|
|
9433
9433
|
Follow the JSON schema definition for each tool's parameters.
|
|
9434
9434
|
You can use multiple tools in one response. DO NOT include text before or after tool calls - wait for the tool results first.
|
|
9435
9435
|
|
|
9436
|
-
|
|
9436
|
+
<tools>`;
|
|
9437
9437
|
const toolDescriptions = tools.map((tool2) => {
|
|
9438
9438
|
if (tool2.type === "function") {
|
|
9439
9439
|
const toolAny = tool2;
|
|
9440
9440
|
const description = toolAny.description || "No description provided";
|
|
9441
9441
|
const schema = toolAny.inputSchema || toolAny.parameters;
|
|
9442
|
-
const
|
|
9443
|
-
|
|
9442
|
+
const schemaStr = schema ? `
|
|
9443
|
+
<schema>
|
|
9444
|
+
${JSON.stringify(schema, null, 2)}
|
|
9445
|
+
</schema>` : "";
|
|
9444
9446
|
return `
|
|
9445
|
-
|
|
9447
|
+
<tool name="${tool2.name}">
|
|
9448
|
+
<description>
|
|
9449
|
+
${description}
|
|
9450
|
+
</description>${schemaStr}
|
|
9451
|
+
</tool>`;
|
|
9446
9452
|
} else if (tool2.type === "provider-defined") {
|
|
9447
9453
|
return `
|
|
9448
|
-
|
|
9454
|
+
<tool name="${tool2.name}">
|
|
9455
|
+
<description>${tool2.id || "No description provided"}</description>
|
|
9456
|
+
</tool>`;
|
|
9449
9457
|
}
|
|
9450
9458
|
return "";
|
|
9451
9459
|
}).filter(Boolean).join("");
|
|
9452
|
-
|
|
9460
|
+
const toolsEnd = `
|
|
9461
|
+
</tools>
|
|
9462
|
+
</available_tools>`;
|
|
9463
|
+
enhanced = enhanced ? `${enhanced}${toolsPrompt}${toolDescriptions}${toolsEnd}` : `${toolsPrompt}${toolDescriptions}${toolsEnd}`.trim();
|
|
9453
9464
|
return enhanced || void 0;
|
|
9454
9465
|
}
|
|
9455
9466
|
/**
|