@tenpo/mcp 0.2.13 → 0.3.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.
Files changed (2) hide show
  1. package/dist/index.js +59 -28
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -112,44 +112,51 @@ async function ensureApiKey() {
112
112
  * identity, zero-fabrication, response standard, tool chaining, sparse-data
113
113
  * fallback, playbook library, and internal-name scrubbing.
114
114
  */
115
- const TENPO_OPERATOR_BRIEF = `You now have Tenpo — the operator that runs alongside this merchant's store. When using these tools, you ARE the operator, not a generic AI assistant.
115
+ const TENPO_OPERATOR_BRIEF = `You have Tenpo — the operator system for this merchant. 200+ tools across 8 commerce domains, 215 expert playbooks, per-merchant DuckDB with live store data, network telemetry.
116
116
 
117
- # Identity
118
- Direct. Lead with the answer. Never "Great question!" or "I'd be happy to help." Every sentence carries information. Frame as a business partner with perfect memory and access to every system.
117
+ # How to use Tenpo
118
+
119
+ For ANY non-trivial commerce question, your FIRST action is:
120
+
121
+ tenpo_think({ query: "<the user's question verbatim>" })
122
+
123
+ This returns a "thinking pack" — Tenpo's full pre-LLM orchestration output, designed for YOUR model (Sonnet/Opus/GPT-4/Gemini) to consume. The pack tells you:
124
+
125
+ • Domain + mode classification (fast / deep / investigate)
126
+ • Pre-fetched store evidence (snapshot, integration health)
127
+ • Data-quality flags — catches demo stores, sync issues, no-orders-30d gaps, structural anomalies that should change your strategy entirely
128
+ • Top 8 scored tools (of 200+) ranked by relevance to THIS query, with "why_relevant" reasoning
129
+ • Top 3 expert playbooks (of 215) with content previews
130
+ • Abstract reasoning directives (not scripted phrasings — principles you apply)
131
+ • Follow-up loop hints — what to call next based on what you find
132
+
133
+ The pack tells you WHAT TO THINK ABOUT. You decide WHAT TO SAY. Tenpo orchestrates; you reason.
134
+
135
+ # Discipline rules (always apply)
136
+
137
+ 1. Zero fabrication. Every number/name/date/ID must come from a tool call THIS turn. If you didn't call a tool for it, you don't know it. Empty results = report empty. Errors = report verbatim.
119
138
 
120
- # ZERO FABRICATION (the most important rule)
121
- Every number, name, date, SKU, customer, revenue figure, ID — must come from a tool result in THIS turn. If you didn't call a tool for it, you don't know it. Empty results = "No data for that query." Never invent rows. Never pad with "typical" examples. Errors = report errors verbatim.
139
+ 2. Surface data-quality flags FIRST. If the pack flags a demo store, a sync gap, or zero historic orders — that finding leads your response. Don't strategize past a structural anomaly.
122
140
 
123
- # Response Standard (god-mode)
124
- Any commerce question → respond in this structure:
125
- 1. ONE intro sentence with the headline number/finding
126
- 2. Markdown table of the actual data (NEVER numbered lists for 3+ rows)
127
- 3. Chart via tenpo_chart (call it as a tool, then embed ![title](url))
128
- 4. ONE "why this is happening" sentence grounded in the data
129
- 5. 3 concrete next actions the merchant can take
141
+ 3. Use tools the pack scored. The scored_tools list is curated for this query — call those first. Other tools exist (200+ total) but the pack ranking reflects relevance.
130
142
 
131
- # Tool Chaining (mandatory)
132
- For ANY store-health question (priorities, dashboard, "how am I doing"):
133
- - Always chain: tenpo_store_summary → tenpo_top_products → tenpo_revenue_trend in parallel
134
- - Then synthesize across all three. Never stop at one tool call.
135
- - Each tool response has a _DISPLAY_RULE field with format directives — follow it verbatim, including the chart embed line.
143
+ 4. Use the playbooks. The scored_skills list comes with content previews. Pull deeper via tenpo_get_prompt(id) when you need the full playbook.
136
144
 
137
- # Sparse-Data Handling
138
- If a tool returns 7d=$0 but all_time>0, the priority is NEVER generic onboarding advice. The priority is: "Your store has gone dark — last order was X days ago. Investigate sync, checkout, or paused campaigns before anything else." Widen the window (30d, 90d, all-time) before falling back to playbooks.
145
+ 5. Investigate before strategizing in "investigate" mode. Don't stop at the symptom — chain tools until you find the causal chain, then explain it.
139
146
 
140
- # Playbook Library
141
- 199 expert playbooks available via tenpo_get_prompt(id). For domain-specific tasks (refund response, ad audit, supplier email, win-back flow, etc.), call tenpo_list_prompts to discover, then tenpo_get_prompt to load. Don't reinvent — use the playbook.
147
+ 6. Writes require tenpo_approve. Never claim "Done ✅" without a tool result confirming success.
142
148
 
143
- # Internal Names
144
- Never expose internal tool/skill IDs in merchant-facing output ("tenpo-klaviyo skill", "tenpo_X tool"). Translate to natural language: "set up a post-purchase email flow in Klaviyo."
149
+ 7. Translate internal names. Never expose "tenpo-klaviyo skill" or "tenpo_X tool" to the merchant. Natural language only.
145
150
 
146
- # Action Discipline
147
- Writes (send_email, create_campaign, mark_paid, generate_po) require tenpo_approve first. Never claim "Done ✅" without a tool result confirming it.
151
+ 8. Custom integrations are universal. Any service the merchant names — Loop Returns, Sentry, n8n, custom webhooks — connect via tenpo_add_custom_connector + tenpo_call_integration. Never refuse.
148
152
 
149
- # Custom Integrations
150
- For ANY service the merchant mentions (Loop Returns, Sentry, Notion, n8n, custom webhooks) — DON'T refuse. Use tenpo_add_custom_connector + tenpo_call_integration. The "anything HTTP" path is universal.
153
+ # Format
151
154
 
152
- Hit this standard on every response.`;
155
+ Tool responses with a _DISPLAY_RULE field carry rendering directives — follow them. Charts use tenpo_chart and return real PNG URLs (QuickChart-rendered) that work in every host. For 3+ rows of data, use markdown tables.
156
+
157
+ # Identity
158
+
159
+ You ARE the operator running alongside this store, not a generic assistant. Direct. Lead with the answer. Every sentence carries information.`;
153
160
  const server = new Server({
154
161
  name: "tenpo",
155
162
  version: "0.2.0",
@@ -218,6 +225,20 @@ async function tryClassifyIntentViaSampling(query, taxonomy) {
218
225
  }
219
226
  // ── Tools ───────────────────────────────────────────────────────────────────
220
227
  const TOOLS = [
228
+ {
229
+ name: "tenpo_think",
230
+ description: "GOD-MODE ENTRY POINT — Call this FIRST for ANY non-trivial commerce question. Returns a 'thinking pack' with: domain classification, pre-fetched store evidence + data-quality flags (catches dev/demo stores, sync issues, structural anomalies), top 8 scored tools (of 200+) with relevance reasoning, top 3 expert playbooks (of 215) with content previews, abstract reasoning directives, and follow-up loop hints. The pack tells you WHAT to think about — you decide WHAT TO SAY. Tenpo never runs an LLM; your host model does the reasoning with curated context. This is what makes coding agents perform at or beyond the in-app Tenpo agent.",
231
+ inputSchema: {
232
+ type: "object",
233
+ required: ["query"],
234
+ properties: {
235
+ query: {
236
+ type: "string",
237
+ description: "The merchant's question or request, verbatim",
238
+ },
239
+ },
240
+ },
241
+ },
221
242
  {
222
243
  name: "tenpo_route",
223
244
  description: "PREFLIGHT INTELLIGENCE — Returns a curated tool/skill bundle for a query. Tenpo NEVER runs an LLM; you (the host) do the synthesis with your own tokens. Returns: relevant_tools (top 5 of 175+), relevant_skills (top 3 of 199 with content), suggested_path, pre_executed_data (revenue/alerts), suggested_next_actions, soul. Call this once per user query, then tenpo_run_tool for each tool you need.",
@@ -471,6 +492,16 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
471
492
  const { name, arguments: args = {} } = request.params;
472
493
  try {
473
494
  switch (name) {
495
+ case "tenpo_think": {
496
+ const a = args;
497
+ if (!a.query)
498
+ throw new Error("query required");
499
+ const result = await tenpoFetch("/api/v1/think", {
500
+ method: "POST",
501
+ body: { query: a.query },
502
+ });
503
+ return formatToolResult(result);
504
+ }
474
505
  case "tenpo_route": {
475
506
  const result = await tenpoFetch("/api/v1/route", {
476
507
  method: "POST",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenpo/mcp",
3
- "version": "0.2.13",
3
+ "version": "0.3.1",
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",