mcp-tabula-api 3.1.0 → 3.1.1
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/dist/index.js +13 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31211,12 +31211,22 @@ function createMcpServer() {
|
|
|
31211
31211
|
query: exports_external.string().describe("Text to search inside note contents.")
|
|
31212
31212
|
}, async ({ query }) => {
|
|
31213
31213
|
try {
|
|
31214
|
-
const
|
|
31214
|
+
const DISPLAY = 20;
|
|
31215
|
+
const PROBE = 500;
|
|
31216
|
+
const results = await search("@" + query, PROBE);
|
|
31215
31217
|
if (!results.length)
|
|
31216
31218
|
return { content: [{ type: "text", text: `No matches found for '${query}'` }] };
|
|
31217
|
-
const
|
|
31219
|
+
const shown = results.slice(0, DISPLAY);
|
|
31220
|
+
const lines = shown.map((r) => r.snippet ? `${r.name}: ${r.snippet}` : r.name).join(`
|
|
31218
31221
|
`);
|
|
31219
|
-
|
|
31222
|
+
let header = "";
|
|
31223
|
+
if (results.length > DISPLAY) {
|
|
31224
|
+
const total = results.length >= PROBE ? `${PROBE}+` : `${results.length}`;
|
|
31225
|
+
header = `Showing top ${DISPLAY} of ${total} matches for '${query}' — narrow the query to surface the rest.
|
|
31226
|
+
|
|
31227
|
+
`;
|
|
31228
|
+
}
|
|
31229
|
+
return { content: [{ type: "text", text: header + lines }] };
|
|
31220
31230
|
} catch (err) {
|
|
31221
31231
|
return { content: [{ type: "text", text: `Failed: ${err.message}` }] };
|
|
31222
31232
|
}
|