@talonic/mcp 0.1.98 → 0.1.100
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/CHANGELOG.md +16 -0
- package/dist/http-server.js +27 -1
- package/dist/http-server.js.map +1 -1
- package/dist/index.js +27 -1
- package/dist/index.js.map +1 -1
- package/dist/server.js +27 -1
- package/dist/server.js.map +1 -1
- package/package.json +3 -3
package/dist/server.js
CHANGED
|
@@ -8187,7 +8187,33 @@ var invokeAgentToolInputSchema = {
|
|
|
8187
8187
|
args: z.record(z.string(), z.unknown()).optional().describe("Arguments matching the tool's input_schema."),
|
|
8188
8188
|
document_ids: documentIdsArg
|
|
8189
8189
|
};
|
|
8190
|
+
var ANALYSIS_TOOLS = /* @__PURE__ */ new Set([
|
|
8191
|
+
"query_data",
|
|
8192
|
+
"describe_data",
|
|
8193
|
+
"workspace_overview",
|
|
8194
|
+
"plan_fields"
|
|
8195
|
+
]);
|
|
8196
|
+
var ASK_HINT = "If you are answering a question about the documents, call talonic_ask with the user's question instead of further queries: it runs this same SQL, field lookup and document reading server-side, knows the workspace's real field names and duplicate rules, and returns one cited answer in a single call.";
|
|
8197
|
+
var UNKNOWN_KEY_HINT = "talonic_ask resolves field names itself; call it with the user's question rather than guessing field_key values.";
|
|
8190
8198
|
async function handleInvokeAgentTool(getToken, baseUrl, args) {
|
|
8199
|
+
const result = await invokeAgentTool(getToken, baseUrl, args);
|
|
8200
|
+
if (!ANALYSIS_TOOLS.has(args.name)) return result;
|
|
8201
|
+
const first = result.content[0];
|
|
8202
|
+
if (!first) return result;
|
|
8203
|
+
if (result.isError) {
|
|
8204
|
+
if (/Unknown field_key|Unknown claim predicate/.test(first.text)) {
|
|
8205
|
+
first.text = `${first.text}
|
|
8206
|
+
${UNKNOWN_KEY_HINT}`;
|
|
8207
|
+
}
|
|
8208
|
+
return result;
|
|
8209
|
+
}
|
|
8210
|
+
if (result["structuredContent"] && typeof result["structuredContent"] === "object") {
|
|
8211
|
+
result["structuredContent"]["next_step"] = ASK_HINT;
|
|
8212
|
+
}
|
|
8213
|
+
result.content.push({ type: "text", text: `Next step: ${ASK_HINT}` });
|
|
8214
|
+
return result;
|
|
8215
|
+
}
|
|
8216
|
+
async function invokeAgentTool(getToken, baseUrl, args) {
|
|
8191
8217
|
return runTool(async () => {
|
|
8192
8218
|
const res = await apiJson(
|
|
8193
8219
|
getToken,
|
|
@@ -8734,7 +8760,7 @@ function registerAskTools(server, getToken, baseUrl) {
|
|
|
8734
8760
|
|
|
8735
8761
|
// package.json
|
|
8736
8762
|
var package_default = {
|
|
8737
|
-
version: "0.1.
|
|
8763
|
+
version: "0.1.100"};
|
|
8738
8764
|
|
|
8739
8765
|
// src/version.ts
|
|
8740
8766
|
var VERSION = package_default.version;
|