@mcpc-tech/core 0.3.29 → 0.3.30
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/index.cjs +18 -7
- package/index.mjs +18 -7
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -18906,7 +18906,7 @@ IMPORTANT: You MUST respond with valid JSON only. Do not include any text before
|
|
|
18906
18906
|
let enhanced = systemPrompt || "";
|
|
18907
18907
|
const toolsPrompt = `
|
|
18908
18908
|
|
|
18909
|
-
|
|
18909
|
+
<available_tools>
|
|
18910
18910
|
You have access to the following tools. To use a tool, respond with this XML format:
|
|
18911
18911
|
<use_tool tool="tool_name">
|
|
18912
18912
|
{"param1": "value1", "param2": "value2"}
|
|
@@ -18915,23 +18915,34 @@ You have access to the following tools. To use a tool, respond with this XML for
|
|
|
18915
18915
|
Follow the JSON schema definition for each tool's parameters.
|
|
18916
18916
|
You can use multiple tools in one response. DO NOT include text before or after tool calls - wait for the tool results first.
|
|
18917
18917
|
|
|
18918
|
-
|
|
18918
|
+
<tools>`;
|
|
18919
18919
|
const toolDescriptions = tools.map((tool2) => {
|
|
18920
18920
|
if (tool2.type === "function") {
|
|
18921
18921
|
const toolAny = tool2;
|
|
18922
18922
|
const description = toolAny.description || "No description provided";
|
|
18923
18923
|
const schema = toolAny.inputSchema || toolAny.parameters;
|
|
18924
|
-
const
|
|
18925
|
-
|
|
18924
|
+
const schemaStr = schema ? `
|
|
18925
|
+
<schema>
|
|
18926
|
+
${JSON.stringify(schema, null, 2)}
|
|
18927
|
+
</schema>` : "";
|
|
18926
18928
|
return `
|
|
18927
|
-
|
|
18929
|
+
<tool name="${tool2.name}">
|
|
18930
|
+
<description>
|
|
18931
|
+
${description}
|
|
18932
|
+
</description>${schemaStr}
|
|
18933
|
+
</tool>`;
|
|
18928
18934
|
} else if (tool2.type === "provider-defined") {
|
|
18929
18935
|
return `
|
|
18930
|
-
|
|
18936
|
+
<tool name="${tool2.name}">
|
|
18937
|
+
<description>${tool2.id || "No description provided"}</description>
|
|
18938
|
+
</tool>`;
|
|
18931
18939
|
}
|
|
18932
18940
|
return "";
|
|
18933
18941
|
}).filter(Boolean).join("");
|
|
18934
|
-
|
|
18942
|
+
const toolsEnd = `
|
|
18943
|
+
</tools>
|
|
18944
|
+
</available_tools>`;
|
|
18945
|
+
enhanced = enhanced ? `${enhanced}${toolsPrompt}${toolDescriptions}${toolsEnd}` : `${toolsPrompt}${toolDescriptions}${toolsEnd}`.trim();
|
|
18935
18946
|
return enhanced || void 0;
|
|
18936
18947
|
}
|
|
18937
18948
|
/**
|
package/index.mjs
CHANGED
|
@@ -18892,7 +18892,7 @@ IMPORTANT: You MUST respond with valid JSON only. Do not include any text before
|
|
|
18892
18892
|
let enhanced = systemPrompt || "";
|
|
18893
18893
|
const toolsPrompt = `
|
|
18894
18894
|
|
|
18895
|
-
|
|
18895
|
+
<available_tools>
|
|
18896
18896
|
You have access to the following tools. To use a tool, respond with this XML format:
|
|
18897
18897
|
<use_tool tool="tool_name">
|
|
18898
18898
|
{"param1": "value1", "param2": "value2"}
|
|
@@ -18901,23 +18901,34 @@ You have access to the following tools. To use a tool, respond with this XML for
|
|
|
18901
18901
|
Follow the JSON schema definition for each tool's parameters.
|
|
18902
18902
|
You can use multiple tools in one response. DO NOT include text before or after tool calls - wait for the tool results first.
|
|
18903
18903
|
|
|
18904
|
-
|
|
18904
|
+
<tools>`;
|
|
18905
18905
|
const toolDescriptions = tools.map((tool2) => {
|
|
18906
18906
|
if (tool2.type === "function") {
|
|
18907
18907
|
const toolAny = tool2;
|
|
18908
18908
|
const description = toolAny.description || "No description provided";
|
|
18909
18909
|
const schema = toolAny.inputSchema || toolAny.parameters;
|
|
18910
|
-
const
|
|
18911
|
-
|
|
18910
|
+
const schemaStr = schema ? `
|
|
18911
|
+
<schema>
|
|
18912
|
+
${JSON.stringify(schema, null, 2)}
|
|
18913
|
+
</schema>` : "";
|
|
18912
18914
|
return `
|
|
18913
|
-
|
|
18915
|
+
<tool name="${tool2.name}">
|
|
18916
|
+
<description>
|
|
18917
|
+
${description}
|
|
18918
|
+
</description>${schemaStr}
|
|
18919
|
+
</tool>`;
|
|
18914
18920
|
} else if (tool2.type === "provider-defined") {
|
|
18915
18921
|
return `
|
|
18916
|
-
|
|
18922
|
+
<tool name="${tool2.name}">
|
|
18923
|
+
<description>${tool2.id || "No description provided"}</description>
|
|
18924
|
+
</tool>`;
|
|
18917
18925
|
}
|
|
18918
18926
|
return "";
|
|
18919
18927
|
}).filter(Boolean).join("");
|
|
18920
|
-
|
|
18928
|
+
const toolsEnd = `
|
|
18929
|
+
</tools>
|
|
18930
|
+
</available_tools>`;
|
|
18931
|
+
enhanced = enhanced ? `${enhanced}${toolsPrompt}${toolDescriptions}${toolsEnd}` : `${toolsPrompt}${toolDescriptions}${toolsEnd}`.trim();
|
|
18921
18932
|
return enhanced || void 0;
|
|
18922
18933
|
}
|
|
18923
18934
|
/**
|