@tenpo/mcp 0.2.3 → 0.2.5

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/index.js +10 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -382,9 +382,8 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
382
382
  * saw nothing but a stringified blob.
383
383
  */
384
384
  function formatToolResult(result) {
385
- // Type guard: try to pull data.chat_message safely
386
385
  const r = result;
387
- // Error path: backend returned ok:false. Show it cleanly.
386
+ // Error path
388
387
  if (r && r.ok === false) {
389
388
  return {
390
389
  content: [
@@ -394,7 +393,11 @@ function formatToolResult(result) {
394
393
  isError: true,
395
394
  };
396
395
  }
397
- const chatMessage = r?.data?.chat_message;
396
+ // chat_message can live at:
397
+ // data.chat_message — MCP-direct tools (onboarding, can_help_with, etc.)
398
+ // data.details.chat_message — gateway tools wrapped via jsonResult()
399
+ const chatMessage = r?.data?.details?.chat_message ??
400
+ r?.data?.chat_message;
398
401
  if (typeof chatMessage === "string" && chatMessage.length > 0) {
399
402
  // Primary: the chat-ready message. Secondary: structured JSON for introspection.
400
403
  return {
@@ -404,8 +407,10 @@ function formatToolResult(result) {
404
407
  ],
405
408
  };
406
409
  }
407
- // No chat_message — fall back to pretty-printed JSON.
408
- return formatToolResult(result);
410
+ // No chat_message — return JSON directly (no recursion!)
411
+ return {
412
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
413
+ };
409
414
  }
410
415
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
411
416
  await ensureApiKey();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenpo/mcp",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "Tenpo — the operator that runs alongside your store. Connects to 45+ commerce platforms (Shopify, Klaviyo, Meta Ads, GA4, Stripe…) and gives any AI host (Claude Desktop, Cursor, Claude Code, ChatGPT) deterministic answers about your sales, ads, email, inventory, suppliers, customers, finance, and competitors. Free tier, no card required.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://tenpo.ai",