hac-mcp 1.0.3 → 1.0.4
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/package.json +1 -1
- package/tools/flexible_search.js +4 -2
package/package.json
CHANGED
package/tools/flexible_search.js
CHANGED
|
@@ -20,7 +20,9 @@ function parseFlexSearchError(msg) {
|
|
|
20
20
|
|
|
21
21
|
function parseUnknownTypeError(msg) {
|
|
22
22
|
if (!msg) return null;
|
|
23
|
-
const m = msg.match(/unknown type[:\s]+'?(\w+)'?/i)
|
|
23
|
+
const m = msg.match(/unknown type[:\s]+'?(\w+)'?/i)
|
|
24
|
+
|| msg.match(/[Tt]he type '(\w+)' is unknown/)
|
|
25
|
+
|| msg.match(/type code '(\w+)' invalid/i);
|
|
24
26
|
return m?.[1] ?? null;
|
|
25
27
|
}
|
|
26
28
|
|
|
@@ -124,7 +126,7 @@ export const tool = {
|
|
|
124
126
|
let detail = `Unknown type "${unknownType}".`;
|
|
125
127
|
try {
|
|
126
128
|
const types = await getTypeIndex(env);
|
|
127
|
-
const suggestions = fuzzySearch(unknownType, types, { topN:
|
|
129
|
+
const suggestions = fuzzySearch(unknownType, types, { topN: 10 });
|
|
128
130
|
if (suggestions.length) detail += ` Did you mean: ${suggestions.join(', ')}?`;
|
|
129
131
|
} catch (_) {}
|
|
130
132
|
mcpLog({ tool: TOOL, envName: env.name, preview: 'Query error', detail, isError: true, runId });
|