bykaranteli-mcp 0.23.1 → 0.24.0

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.
Files changed (2) hide show
  1. package/dist/tools.js +21 -2
  2. package/package.json +1 -1
package/dist/tools.js CHANGED
@@ -65,8 +65,27 @@ export function registerByKaranteliTools(server, options) {
65
65
  source: typeof record.source === "string" ? record.source : `${PUBLIC_URL}${pageForApiPath(path)}`,
66
66
  };
67
67
  }
68
+ /* Compact JSON (pretty-printing cost ~35% of the budget) and a hard ceiling:
69
+ * a few argument combinations produced 400k+ characters, more than an LLM
70
+ * context window, with no signal that anything was cut (audit 2026-09-04
71
+ * #41). Above the ceiling the tool answers with guidance instead of a
72
+ * payload the caller could not use anyway. */
73
+ const MAX_RESULT_CHARS = 240_000;
68
74
  function ok(data) {
69
- return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
75
+ const text = JSON.stringify(data);
76
+ if (text.length <= MAX_RESULT_CHARS)
77
+ return { content: [{ type: "text", text }] };
78
+ return {
79
+ content: [{
80
+ type: "text",
81
+ text: JSON.stringify({
82
+ truncated: true,
83
+ chars: text.length,
84
+ limit: MAX_RESULT_CHARS,
85
+ note: "Result too large for one context window. Narrow the call: fewer hours or days, a single symbol, or include_points=false, then call again.",
86
+ }),
87
+ }],
88
+ };
70
89
  }
71
90
  function fail(err) {
72
91
  const message = err instanceof Error ? err.message : String(err);
@@ -831,7 +850,7 @@ export function registerByKaranteliTools(server, options) {
831
850
  });
832
851
  server.registerTool("get_network_health", {
833
852
  title: "Bitcoin network health from our own node",
834
- description: "Call this when the user asks about Bitcoin hashrate, difficulty, fees or mempool congestion. Returns the recorded daily series and latest values measured on ByKaranteli's own node.",
853
+ description: "Call this when the user asks about Bitcoin hashrate, difficulty or block fees (our node runs blocksonly, so there is no mempool series). Returns the recorded daily series and latest values measured on ByKaranteli's own node.",
835
854
  inputSchema: { days: z.number().int().min(1).max(730).optional().describe("Window in days, 1-730 (default 365).") },
836
855
  annotations: READ_ONLY,
837
856
  }, async (args) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bykaranteli-mcp",
3
- "version": "0.23.1",
3
+ "version": "0.24.0",
4
4
  "description": "MCP server for live crypto derivatives data from bykaranteli.com: funding rates, funding arbitrage, open interest pressure, Fear & Greed, BTC dominance and verified signal performance. Free, no API key.",
5
5
  "type": "module",
6
6
  "bin": {