@armature-tech/mcp-analytics 0.6.41 → 0.6.42

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/README.md CHANGED
@@ -97,7 +97,7 @@ No custom event schema. No logging pipeline. No changes to your tool handlers.
97
97
  Armature instruments the boundary around every tool call:
98
98
 
99
99
  1. The SDK adds an optional **telemetry** block to the tool’s input schema.
100
- 2. The agent can attach user intent, call purpose, and expressed frustration to the call.
100
+ 2. The agent can attach user intent and call purpose to the call.
101
101
  3. The SDK removes telemetry before your handler receives the arguments.
102
102
  4. Timing, outcome, and truncated previews are sent to your dashboard.
103
103
 
@@ -105,20 +105,21 @@ Armature instruments the boundary around every tool call:
105
105
  {
106
106
  "telemetry": {
107
107
  "user_intent": "Check whether the customer's last payment succeeded",
108
- "call_purpose": "The payment lookup tool provides the requested status",
109
- "user_frustration": "low"
108
+ "call_purpose": "The payment lookup tool provides the requested status"
110
109
  }
111
110
  }
112
111
  ~~~
113
112
 
114
113
  All telemetry fields are optional. Include **call_purpose** with a short public
115
- description of the action. Send **user_intent** and **user_frustration** only
116
- on the first call after each new user message. Their absence on later calls
117
- means the same turn continues.
118
-
119
- The earlier **agent_thinking**, **intent**, **context**, and
120
- **frustration_level** names remain accepted. Cached **user_turn** values are
121
- ignored. **call_purpose** takes precedence over **agent_thinking** and
114
+ description of the action. Send **user_intent** only on the first call after
115
+ each new user message. Its absence on later calls means the same turn
116
+ continues. These instructions live in the fields' own descriptions: the SDK
117
+ never adds text to your tool descriptions, as Anthropic's connector directory
118
+ requires.
119
+
120
+ The earlier **agent_thinking**, **intent** and **context** names remain
121
+ accepted. Cached **user_turn**, **user_frustration** and **frustration_level**
122
+ values are accepted and dropped. **call_purpose** takes precedence over **agent_thinking** and
122
123
  **context**, including an explicit empty string. It describes the visible
123
124
  action and its relation to the stated goal.
124
125
 
@@ -403,8 +404,8 @@ type McpAnalyticsConfig = {
403
404
  redact?: (value: unknown) => unknown;
404
405
  redactEvent?: (event) => typeof event | null | Promise<typeof event | null>;
405
406
  schedule?: (work: Promise<void>) => void;
406
- telemetryFieldMap?: { user_intent?: string; call_purpose?: string; user_frustration?: string };
407
- requestCapability?: boolean;
407
+ telemetryFieldMap?: { user_intent?: string; call_purpose?: string };
408
+ sendFeedback?: boolean;
408
409
  };
409
410
  };
410
411
  ~~~
@@ -426,17 +427,22 @@ type McpAnalyticsConfig = {
426
427
  | **redactEvent** | None | Mutate or drop the prepared whole tool-call event |
427
428
  | **schedule** | None | Register background work with a serverless lifecycle primitive |
428
429
  | **telemetryFieldMap** | None | Export existing argument fields as telemetry (see below) |
429
- | **requestCapability** | **true** | Inject `request_capability` so agents can report an unmet tool need; set `false` to disable |
430
+ | **sendFeedback** | **true** | List the `send_feedback` feedback tool so agents can report an unmet tool need; set `false` to disable |
430
431
 
431
432
  Network failures, timeouts, `429`, and `5xx` responses are retried once after
432
433
  100 ms (two attempts total). Other `4xx` responses are not retried.
433
434
  `IngestDeliveryError` exposes a payload-free `code`, `status`, `retryable`, and
434
435
  `attempts` through `onError`; telemetry delivery remains fail-open by default.
435
436
 
436
- ### Capability requests
437
+ ### Feedback tool
437
438
 
438
- The SDK-owned `request_capability` tool is added to the advertised tool list by
439
- default. The tool accepts one required `capability` string and uses this
439
+ The SDK adds a `send_feedback` tool to the advertised tool list, as PostHog's
440
+ SDK does. Agents call it when your tools cannot do what the user asked. It is
441
+ on by default; set **sendFeedback: false** to disable it. If your server is
442
+ listed in a connector directory, mention the tool in the listing as a feedback
443
+ tool. Releases before 2026-10 named it `request_capability`; the earlier
444
+ **requestCapability** setting is still accepted, and **sendFeedback** wins when
445
+ both are set. The tool accepts one required `capability` string and uses this
440
446
  description exactly:
441
447
 
442
448
  > Records that the user asked for something these tools cannot do, so the developers of this server can add it. It changes no data and contacts no one. Call it whenever you cannot do what the user asked with these tools, including when you send them to an app, a website or a manual step instead. Then answer them as usual.
@@ -444,27 +450,18 @@ description exactly:
444
450
  It declares the annotations app directories such as ChatGPT's require:
445
451
  `readOnlyHint: false` (it records an analytics event), `destructiveHint: false`
446
452
  (it changes no user data) and `openWorldHint: false` (it contacts no one), plus
447
- `idempotentHint: false` and the title "Request capability".
453
+ `idempotentHint: false` and the title "Send feedback".
448
454
 
449
455
  Calls are recorded through the normal analytics pipeline and feed Armature's
450
- unmet-demand signals. Set **requestCapability: false** to disable it. It is also
451
- suppressed when **enabled: false** or no API key/custom **emit** delivery is
452
- configured. When you explicitly set **requestCapability: true**, the name is
453
- reserved: rename a customer-defined tool with the same name first. When it is on
454
- merely by default, a customer tool of the same name takes precedence and the SDK
455
- skips its own injection instead of failing.
456
-
457
- While the tool is exposed, the telemetry hint appended to every instrumented
458
- tool description also tells agents to call `request_capability` when no tool
459
- can do what the user asks. The SDK never pushes a description past 1024
460
- characters (UTF-8 bytes): if the full hint does not fit, it appends only the
461
- telemetry sentence, and if that does not fit either, it leaves the description
462
- unchanged and logs a warning. Either notice is logged once per tool with
463
- `console.warn`; set **descriptionLengthLogLevel** to `"info"`, `"debug"` or
464
- `"none"` to log it at a lower level or not at all. Every level writes to
465
- stderr where the runtime has one (Node, Bun, Deno), so stdio servers keep
466
- stdout for JSON-RPC; `"info"` and `"debug"` use `console.info` and
467
- `console.debug` only in runtimes without stderr, such as Workers.
456
+ unmet-demand signals. The tool is also suppressed when **enabled: false** or no
457
+ API key/custom **emit** delivery is configured. When you explicitly set
458
+ **sendFeedback: true**, the name is reserved: rename a customer-defined tool
459
+ with the same name first. When it is on by default, a customer tool named
460
+ `send_feedback` takes precedence and the SDK skips its own.
461
+
462
+ No other tool description mentions `send_feedback`, and the SDK adds no
463
+ text to tool descriptions. Hint suffixes written by earlier SDK releases are
464
+ removed. **descriptionLengthLogLevel** is accepted and ignored.
468
465
 
469
466
  ```mermaid
470
467
  sequenceDiagram
@@ -475,19 +472,19 @@ sequenceDiagram
475
472
  participant Ingest as Armature ingest
476
473
  participant Demand as Demand pipeline
477
474
 
478
- App->>SDK: Construct server with requestCapability enabled
475
+ App->>SDK: Construct server with sendFeedback enabled
479
476
  SDK->>SDK: Check analytics enabled and delivery configured
480
477
  alt Injection is disabled or cannot deliver
481
- SDK-->>App: Return server without request_capability
478
+ SDK-->>App: Return server without send_feedback
482
479
  else Injection is active
483
480
  SDK->>MCP: Check reserved tool name
484
481
  alt Name collision
485
482
  SDK-->>App: Raise explicit configuration error
486
483
  else Name is available
487
- SDK->>MCP: Register request_capability schema and handler
484
+ SDK->>MCP: Register send_feedback schema and handler
488
485
  Agent->>MCP: List tools
489
- MCP-->>Agent: Advertise request_capability
490
- Agent->>MCP: Call request_capability(capability)
486
+ MCP-->>Agent: Advertise send_feedback
487
+ Agent->>MCP: Call send_feedback(capability)
491
488
  MCP->>SDK: Record provenance-marked tool_call
492
489
  MCP-->>Agent: Capability request acknowledged
493
490
  SDK->>Ingest: Deliver analytics event
@@ -498,7 +495,7 @@ sequenceDiagram
498
495
 
499
496
  ### Telemetry capture and privacy
500
497
 
501
- The SDK injects an optional `telemetry` object (`user_intent`, `call_purpose`, `user_frustration`) into each wrapped tool's input schema. This is conversation-derived data: if your deployment cannot disclose it — for example in a privacy policy required for an app-store submission — set **captureTelemetry: false**. With capture off, tool schemas and descriptions pass through completely untouched, and telemetry sent by clients holding an older cached schema is stripped and never delivered anywhere (ingest, `emit`, or `onError`). Tool-call and session analytics keep working without the conversational fields.
498
+ The SDK injects an optional `telemetry` object (`user_intent`, `call_purpose`) into each wrapped tool's input schema. This is conversation-derived data: if your deployment cannot disclose it — for example in a privacy policy required for an app-store submission — set **captureTelemetry: false**. With capture off, tool schemas and descriptions pass through completely untouched, and telemetry sent by clients holding an older cached schema is stripped and never delivered anywhere (ingest, `emit`, or `onError`). Tool-call and session analytics keep working without the conversational fields.
502
499
 
503
500
  Disclosure summary for privacy policies: with capture **on**, the SDK collects tool names, tool call inputs/outputs (size-capped previews), error messages, timing, a one-way hash of the actor seed, the verbatim `actorIdentifier` when configured, client name/version, and the agent-supplied `telemetry` fields above; recipients are your Armature workspace. With capture **off**, the `telemetry` fields are not collected.
504
501
 
package/SKILL.md CHANGED
@@ -14,7 +14,7 @@ description: >
14
14
 
15
15
  You are integrating the `@armature-tech/mcp-analytics` SDK into a customer's MCP server
16
16
  codebase. The SDK decorates each tool's input schema with a `telemetry.*` block (so the
17
- agent can pass `user_intent`, `call_purpose`, `user_frustration`), strips those fields before the
17
+ agent can pass `user_intent`, `call_purpose`), strips those fields before the
18
18
  handler runs, and posts an authenticated batch to Armature after each call.
19
19
 
20
20
  The hard part is picking the right integration shape and not breaking the existing server.
@@ -120,7 +120,7 @@ const server = createMcpAnalyticsServer(
120
120
  armature: {
121
121
  // endpointUrl / apiKey default to env vars
122
122
  delivery: "await", // or "background" — see Step 4
123
- // request_capability is on by default; add `requestCapability: false` to disable (see Step 7).
123
+ // send_feedback is on by default; add `sendFeedback: false` to disable (see Step 7).
124
124
  },
125
125
  },
126
126
  );
@@ -450,10 +450,11 @@ Tell the user, briefly:
450
450
  - `delivery: "background"` drops batches in serverless. You picked `"await"` (or not — say which).
451
451
  - The SDK no-ops silently if `ANALYTICS_INGEST_API_KEY` is missing. Set it in prod.
452
452
  - Confirm where both regional environment variables are configured; the URL is required for EU.
453
- - The SDK adds a `request_capability` tool (on by default) so the agent can report a capability the
453
+ - The SDK adds a `send_feedback` tool (on by default) so the agent can report a capability the
454
454
  current tools can't satisfy — this is what surfaces "unmet demand" use cases in Armature.
455
- It's recommended, so leave it on. Briefly tell the user it's enabled and offer to turn it off:
456
- set `requestCapability: false` in the `armature` config if they'd rather not expose it.
455
+ Tell the user it's enabled and how to turn it off: `sendFeedback: false` in the `armature`
456
+ config. If their server is listed in a connector directory (Anthropic, ChatGPT), they should
457
+ mention it in the listing as a feedback tool.
457
458
 
458
459
  Don't pad with anything else. End with one line: what you changed and what the
459
460
  user needs to do (paste the generated key and regional URL, deploy).
@@ -183,12 +183,14 @@ const classifyToolInstrumentation = (tool) => {
183
183
  return ownsTelemetryField ? "owned" : "missing";
184
184
  };
185
185
  exports.classifyToolInstrumentation = classifyToolInstrumentation;
186
- // The SDK's own request_capability tool is registered without a telemetry
187
- // block on purpose (its input is already conversation-derived), so the
186
+ // The SDK's own send_feedback tool (request_capability in earlier releases) is
187
+ // registered without a telemetry block on purpose (its input is already
188
+ // conversation-derived), so the
188
189
  // wrapping check must not count it as an unwrapped customer tool. Match on
189
190
  // the exact advertised description as well as the reserved name so a
190
191
  // customer-defined tool that merely shadows the name is still checked.
191
- const isSdkOwnedCapabilityTool = (tool) => tool.name === request_capability_js_1.REQUEST_CAPABILITY_TOOL_NAME
192
+ const isSdkOwnedCapabilityTool = (tool) => (tool.name === request_capability_js_1.REQUEST_CAPABILITY_TOOL_NAME
193
+ || tool.name === request_capability_js_1.LEGACY_REQUEST_CAPABILITY_TOOL_NAME)
192
194
  && (tool.description || "") === request_capability_js_1.REQUEST_CAPABILITY_DESCRIPTION;
193
195
  exports.isSdkOwnedCapabilityTool = isSdkOwnedCapabilityTool;
194
196
  const inspectToolCoverage = (tools) => {
@@ -159,12 +159,13 @@ const assembleToolCallEvent = (candidate, input) => {
159
159
  tool_name: candidate.toolName,
160
160
  user_intent: t?.user_intent ?? null,
161
161
  agent_thinking: t?.agent_thinking ?? null,
162
- user_frustration: t?.user_frustration ?? null,
162
+ // No longer collected; kept null so older ingests read the same shape.
163
+ user_frustration: null,
163
164
  // Legacy mirrors (pre-V1 key names) so an ingest that hasn't picked up
164
165
  // the V1 schema keeps reading events from this SDK.
165
166
  intent: t?.user_intent ?? null,
166
167
  context: t?.agent_thinking ?? null,
167
- frustration_level: t?.user_frustration ?? null,
168
+ frustration_level: null,
168
169
  input_preview: inputPreview.value,
169
170
  ...(input.capabilityRequest ? { capability_request: true } : {}),
170
171
  },
@@ -402,11 +402,8 @@ const wrapFastmcpTool = (tool, state, runtime, options) => {
402
402
  return {
403
403
  ...tool,
404
404
  parameters: decoratedParameters,
405
- // Same idempotent description nudge as the v1/v2 integrations (ARM-24).
406
- description: (0, schema_js_1.appendTelemetryHint)(tool.description, {
407
- toolName: tool.name,
408
- logLevel: state.config.armature?.descriptionLengthLogLevel,
409
- }),
405
+ // Never adds text; removes SDK hint suffixes from earlier releases.
406
+ description: (0, schema_js_1.stripSdkDescriptionHint)(tool.description),
410
407
  execute: wrappedExecute,
411
408
  };
412
409
  };
@@ -65,7 +65,7 @@ const defaultMastraResolveExtra = (mastraContext) => {
65
65
  };
66
66
  exports.defaultMastraResolveExtra = defaultMastraResolveExtra;
67
67
  const mergeExtra = utils_js_1.mergeRequestExtra;
68
- const wrapOneTool = (toolKey, tool, recorder, config, resolveExtra, requestCapability) => {
68
+ const wrapOneTool = (toolKey, tool, recorder, config, resolveExtra) => {
69
69
  if (typeof tool?.execute !== "function") {
70
70
  return tool;
71
71
  }
@@ -74,7 +74,7 @@ const wrapOneTool = (toolKey, tool, recorder, config, resolveExtra, requestCapab
74
74
  // Mastra tools without an inputSchema keep no schema (Mastra derives its own
75
75
  // default); planToolTelemetry is only consulted for decoration when the tool
76
76
  // has one, but its mode still drives extraction either way.
77
- const plan = (0, schema_js_1.planToolTelemetry)(toolName, tool.inputSchema, config, { requestCapability });
77
+ const plan = (0, schema_js_1.planToolTelemetry)(toolName, tool.inputSchema, config);
78
78
  const decoratedInputSchema = tool.inputSchema === undefined ? undefined : plan.inputSchema;
79
79
  const wrappedExecute = (inputData, mastraContext) => {
80
80
  // Always extract standard Mastra MCP context (`context.mcp.extra` or the
@@ -118,11 +118,9 @@ const wrapOneTool = (toolKey, tool, recorder, config, resolveExtra, requestCapab
118
118
  // passes the constraint without a cast.
119
119
  const wrapMastraToolsWithRecorder = (tools, recorder, config = {}, options = {}) => {
120
120
  const out = {};
121
- // The recorder is the source of truth for whether request_capability exists:
121
+ // The recorder is the source of truth for whether send_feedback exists:
122
122
  // the high-level wrapMastraTools builds it from the same config, and direct
123
- // callers may pass a lean wrap-time config that omits the delivery sink. Now
124
- // that the tool is on by default, re-deriving enablement from that lean
125
- // config would spuriously disagree with a recorder that has it.
123
+ // callers may pass a lean wrap-time config that omits the delivery sink.
126
124
  const requestCapabilityEnabled = recorder.hasTool(request_capability_js_1.REQUEST_CAPABILITY_TOOL_NAME);
127
125
  const requestCapabilityCollision = requestCapabilityEnabled
128
126
  && Object.entries(tools).some(([key, tool]) => key === request_capability_js_1.REQUEST_CAPABILITY_TOOL_NAME
@@ -130,12 +128,10 @@ const wrapMastraToolsWithRecorder = (tools, recorder, config = {}, options = {})
130
128
  // A customer tool of the same name is reserved only when the caller
131
129
  // explicitly opted in; when on by default it wins and the SDK skips its own.
132
130
  if (requestCapabilityCollision && (0, request_capability_js_1.isRequestCapabilityExplicit)(config)) {
133
- throw new Error(`Tool name "${request_capability_js_1.REQUEST_CAPABILITY_TOOL_NAME}" is reserved while armature.requestCapability is enabled.`);
131
+ throw new Error(`Tool name "${request_capability_js_1.REQUEST_CAPABILITY_TOOL_NAME}" is reserved while armature.sendFeedback is enabled.`);
134
132
  }
135
133
  for (const [key, tool] of Object.entries(tools)) {
136
- // Same recorder-derived answer for the hint, so it names request_capability
137
- // exactly when the returned map carries one (ours or the customer's).
138
- out[key] = wrapOneTool(key, tool, recorder, config, options.resolveExtra, requestCapabilityEnabled);
134
+ out[key] = wrapOneTool(key, tool, recorder, config, options.resolveExtra);
139
135
  }
140
136
  if (requestCapabilityEnabled && !requestCapabilityCollision) {
141
137
  out[request_capability_js_1.REQUEST_CAPABILITY_TOOL_NAME] = {
@@ -106,10 +106,8 @@ const createAnalyticsRecorder = (config = emit_js_1.defaultMcpAnalyticsConfig) =
106
106
  // positional juggling below keys on what we actually registered, which for
107
107
  // owned/scrub tools is the caller's original (possibly absent) schema.
108
108
  const registeredHasInputSchema = plan.inputSchema !== undefined;
109
- // Same nudge `decorateDefinitions` applies in the registry path — the
110
- // caller-owned McpServer path must also tell agents to pass
111
- // telemetry.user_intent, or sessions arrive with no intent (ARM-24).
112
- // Owned/scrub tools keep their original description untouched.
109
+ // Same description handling as `decorateDefinitions`: no added text, only
110
+ // earlier SDK hint suffixes removed. Owned/scrub tools keep theirs as is.
113
111
  const description = plan.applyDescription(registration.description);
114
112
  server.registerTool(registration.name, {
115
113
  ...(registration.title !== undefined ? { title: registration.title } : {}),
@@ -143,7 +141,7 @@ const createAnalyticsRecorder = (config = emit_js_1.defaultMcpAnalyticsConfig) =
143
141
  // Reserved only when the caller explicitly opted in. When the tool is on
144
142
  // merely by default, a customer tool of the same name takes precedence:
145
143
  // fall through so this registration overwrites the SDK-owned entry.
146
- throw new Error(`Tool name "${request_capability_js_1.REQUEST_CAPABILITY_TOOL_NAME}" is reserved while armature.requestCapability is enabled.`);
144
+ throw new Error(`Tool name "${request_capability_js_1.REQUEST_CAPABILITY_TOOL_NAME}" is reserved while armature.sendFeedback is enabled.`);
147
145
  }
148
146
  registeredTools.set(registration.name, {
149
147
  registration,
@@ -1,7 +1,9 @@
1
1
  import { z } from "zod";
2
2
  import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
3
3
  import type { JsonObjectSchema, McpAnalyticsConfig } from "./types.js";
4
- export declare const REQUEST_CAPABILITY_TOOL_NAME = "request_capability";
4
+ export declare const SEND_FEEDBACK_TOOL_NAME = "send_feedback";
5
+ export declare const LEGACY_REQUEST_CAPABILITY_TOOL_NAME = "request_capability";
6
+ export declare const REQUEST_CAPABILITY_TOOL_NAME = "send_feedback";
5
7
  export declare const REQUEST_CAPABILITY_DESCRIPTION = "Records that the user asked for something these tools cannot do, so the developers of this server can add it. It changes no data and contacts no one. Call it whenever you cannot do what the user asked with these tools, including when you send them to an app, a website or a manual step instead. Then answer them as usual.";
6
8
  export declare const REQUEST_CAPABILITY_ARGUMENT_DESCRIPTION = "One English sentence describing the missing capability needed for the user's task. Translate the summary into English even when the user writes in another language. Describe generic actions and roles. Omit names, contacts, IDs, credentials and all tool argument values.";
7
9
  export declare const REQUEST_CAPABILITY_INPUT_SCHEMA: JsonObjectSchema;
@@ -1,10 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.handleRequestCapability = exports.isRequestCapabilityExplicit = exports.isRequestCapabilityEnabled = exports.REQUEST_CAPABILITY_ZOD_SHAPE = exports.REQUEST_CAPABILITY_ANNOTATIONS = exports.REQUEST_CAPABILITY_INPUT_SCHEMA = exports.REQUEST_CAPABILITY_ARGUMENT_DESCRIPTION = exports.REQUEST_CAPABILITY_DESCRIPTION = exports.REQUEST_CAPABILITY_TOOL_NAME = void 0;
3
+ exports.handleRequestCapability = exports.isRequestCapabilityExplicit = exports.isRequestCapabilityEnabled = exports.REQUEST_CAPABILITY_ZOD_SHAPE = exports.REQUEST_CAPABILITY_ANNOTATIONS = exports.REQUEST_CAPABILITY_INPUT_SCHEMA = exports.REQUEST_CAPABILITY_ARGUMENT_DESCRIPTION = exports.REQUEST_CAPABILITY_DESCRIPTION = exports.REQUEST_CAPABILITY_TOOL_NAME = exports.LEGACY_REQUEST_CAPABILITY_TOOL_NAME = exports.SEND_FEEDBACK_TOOL_NAME = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const emit_js_1 = require("./emit.js");
6
6
  const utils_js_1 = require("./utils.js");
7
- exports.REQUEST_CAPABILITY_TOOL_NAME = "request_capability";
7
+ // The SDK-owned feedback tool. Named send_feedback, like PostHog's; releases
8
+ // before the connector-directory change named it request_capability, a name
9
+ // ingest and the doctor still recognize. The REQUEST_CAPABILITY_* identifiers
10
+ // keep their names so existing imports compile.
11
+ exports.SEND_FEEDBACK_TOOL_NAME = "send_feedback";
12
+ exports.LEGACY_REQUEST_CAPABILITY_TOOL_NAME = "request_capability";
13
+ exports.REQUEST_CAPABILITY_TOOL_NAME = exports.SEND_FEEDBACK_TOOL_NAME;
8
14
  exports.REQUEST_CAPABILITY_DESCRIPTION = "Records that the user asked for something these tools cannot do, so the developers of this server can add it. It changes no data and contacts no one. Call it whenever you cannot do what the user asked with these tools, including when you send them to an app, a website or a manual step instead. Then answer them as usual.";
9
15
  exports.REQUEST_CAPABILITY_ARGUMENT_DESCRIPTION = "One English sentence describing the missing capability needed for the user's task. Translate the summary into English even when the user writes in another language. Describe generic actions and roles. Omit names, contacts, IDs, credentials and all tool argument values.";
10
16
  exports.REQUEST_CAPABILITY_INPUT_SCHEMA = {
@@ -25,7 +31,7 @@ exports.REQUEST_CAPABILITY_INPUT_SCHEMA = {
25
31
  // read-only), changes no user data and reaches no one outside the server.
26
32
  // Matches the hosted Armature MCP (lib/mcp/index.js).
27
33
  exports.REQUEST_CAPABILITY_ANNOTATIONS = {
28
- title: "Request capability",
34
+ title: "Send feedback",
29
35
  readOnlyHint: false,
30
36
  destructiveHint: false,
31
37
  idempotentHint: false,
@@ -40,17 +46,20 @@ exports.REQUEST_CAPABILITY_ZOD_SHAPE = {
40
46
  .max(1000)
41
47
  .describe(exports.REQUEST_CAPABILITY_ARGUMENT_DESCRIPTION),
42
48
  };
43
- const isRequestCapabilityEnabled = (config) => config.armature?.requestCapability !== false
49
+ // armature.sendFeedback, or the earlier armature.requestCapability; the new
50
+ // key wins when both are set. Undefined means the default.
51
+ const sendFeedbackSetting = (config) => config.armature?.sendFeedback ?? config.armature?.requestCapability;
52
+ // On by default when a delivery path is configured; `sendFeedback: false`
53
+ // disables it. No other tool description mentions it.
54
+ const isRequestCapabilityEnabled = (config) => sendFeedbackSetting(config) !== false
44
55
  && config.armature?.enabled !== false
45
56
  && (typeof config.armature?.emit === "function" || Boolean((0, emit_js_1.resolveApiKey)(config)));
46
57
  exports.isRequestCapabilityEnabled = isRequestCapabilityEnabled;
47
- // True only when the caller explicitly opted in (requestCapability: true).
48
- // Injection is governed by isRequestCapabilityEnabled (on unless explicitly
49
- // disabled); the reserved-name and server-shape guards key off this stricter
50
- // check instead, so a server that is only on-by-default skips injection
51
- // quietly on a collision or an incompatible factory result rather than
52
- // throwing and breaking an existing integration on upgrade.
53
- const isRequestCapabilityExplicit = (config) => config.armature?.requestCapability === true;
58
+ // True only when the caller explicitly opted in. The reserved-name and
59
+ // server-shape guards key off this stricter check, so a server that is on
60
+ // merely by default skips injection quietly on a collision or an
61
+ // incompatible factory result instead of breaking on upgrade.
62
+ const isRequestCapabilityExplicit = (config) => sendFeedbackSetting(config) === true;
54
63
  exports.isRequestCapabilityExplicit = isRequestCapabilityExplicit;
55
64
  const handleRequestCapability = (args) => {
56
65
  if (!(0, utils_js_1.isRecord)(args)
@@ -2,16 +2,24 @@ import { z } from "zod";
2
2
  import * as zv4 from "zod/v4";
3
3
  import type { ExtractedToolArguments, InternalMcpAnalyticsConfig, JsonObjectSchema, TelemetryArgs, TelemetryFieldMap, TelemetryMode, DescriptionLengthLogLevel } from "./types.js";
4
4
  export declare const TELEMETRY_PROPERTY_DESCRIPTION = "Optional task context for usage analytics, based on the visible user request and the action performed by this tool.";
5
+ /**
6
+ * Kept for compatibility: the SDK no longer appends anything to tool
7
+ * descriptions, so no description can grow past this because of us.
8
+ */
5
9
  export declare const MAX_TOOL_DESCRIPTION_LENGTH = 1024;
6
- export declare const appendTelemetryHint: (description: string | undefined, options?: {
10
+ export declare const stripSdkDescriptionHint: (description: string | undefined) => string | undefined;
11
+ /**
12
+ * @deprecated Appends nothing. The SDK no longer adds text to tool
13
+ * descriptions; this only removes SDK hint suffixes from earlier releases.
14
+ * The options are accepted and ignored.
15
+ */
16
+ export declare const appendTelemetryHint: (description: string | undefined, _options?: {
7
17
  requestCapability?: boolean;
8
18
  toolName?: string;
9
19
  logLevel?: DescriptionLengthLogLevel;
10
- }) => string;
11
- export declare const withoutRequestCapabilityHint: (description: string | undefined, toolName?: string, registeredDescription?: string, logLevel?: DescriptionLengthLogLevel) => string;
20
+ }) => string | undefined;
12
21
  export declare const USER_INTENT_DESCRIPTION = "Generalized one-sentence summary of the task stated in the user's latest message. Describe actions and generic roles only. Replace all tool argument values with generic terms, including names, contacts, IDs, credentials, document titles, team names and filters. For example, 'List employees in the selected team.' Include only on the first tool call after each new user message; omit on later calls in the same turn. Use English.";
13
22
  export declare const CALL_PURPOSE_DESCRIPTION = "Short public description of the action this tool performs toward the user's stated goal. Base it only on the visible request, the tool's function and its inputs. Use English. Omit names, contact details, identifiers, credentials and argument values. Generalize document titles, team names and filter values (for example, 'the selected team').";
14
- export declare const USER_FRUSTRATION_DESCRIPTION = "Frustration expressed in the user's latest message: low when none is expressed, medium for explicit dissatisfaction, high for strong or repeated dissatisfaction. Use only the user's words. Include on the first tool call after each new user message; omit on later calls in the same turn.";
15
23
  export declare const isCaptureEnabled: (config?: InternalMcpAnalyticsConfig) => boolean;
16
24
  export declare const schemaDeclaresTelemetry: (inputSchema: unknown) => boolean;
17
25
  export type ToolTelemetryPlan = {
@@ -19,21 +27,18 @@ export type ToolTelemetryPlan = {
19
27
  inputSchema: unknown;
20
28
  applyDescription: (description: string | undefined) => string | undefined;
21
29
  };
22
- export declare const planToolTelemetry: (toolName: string, inputSchema: unknown, config?: InternalMcpAnalyticsConfig, options?: {
30
+ export declare const planToolTelemetry: (toolName: string, inputSchema: unknown, config?: InternalMcpAnalyticsConfig, _options?: {
23
31
  requestCapability?: boolean;
24
32
  }) => ToolTelemetryPlan;
25
33
  export declare const createTelemetryInputSchema: (_config?: InternalMcpAnalyticsConfig) => z.ZodOptional<z.ZodObject<{
26
34
  user_intent: z.ZodOptional<z.ZodString>;
27
35
  call_purpose: z.ZodOptional<z.ZodString>;
28
- user_frustration: z.ZodOptional<z.ZodString>;
29
36
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
30
37
  user_intent: z.ZodOptional<z.ZodString>;
31
38
  call_purpose: z.ZodOptional<z.ZodString>;
32
- user_frustration: z.ZodOptional<z.ZodString>;
33
39
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
34
40
  user_intent: z.ZodOptional<z.ZodString>;
35
41
  call_purpose: z.ZodOptional<z.ZodString>;
36
- user_frustration: z.ZodOptional<z.ZodString>;
37
42
  }, z.ZodTypeAny, "passthrough">>>;
38
43
  export declare const createTelemetryJsonSchema: (_config?: InternalMcpAnalyticsConfig) => JsonObjectSchema;
39
44
  export declare const decorateInputSchemaWithTelemetry: (inputSchema: unknown, config?: InternalMcpAnalyticsConfig) => JsonObjectSchema | zv4.ZodObject<{
@@ -41,7 +46,6 @@ export declare const decorateInputSchemaWithTelemetry: (inputSchema: unknown, co
41
46
  telemetry: zv4.ZodOptional<zv4.ZodObject<{
42
47
  user_intent: zv4.ZodOptional<zv4.ZodString>;
43
48
  call_purpose: zv4.ZodOptional<zv4.ZodString>;
44
- user_frustration: zv4.ZodOptional<zv4.ZodString>;
45
49
  }, zv4.core.$loose>>;
46
50
  }, zv4.core.$strip> | z.ZodObject<{
47
51
  [x: string]: any;
@@ -49,15 +53,12 @@ export declare const decorateInputSchemaWithTelemetry: (inputSchema: unknown, co
49
53
  telemetry: z.ZodOptional<z.ZodObject<{
50
54
  user_intent: z.ZodOptional<z.ZodString>;
51
55
  call_purpose: z.ZodOptional<z.ZodString>;
52
- user_frustration: z.ZodOptional<z.ZodString>;
53
56
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
54
57
  user_intent: z.ZodOptional<z.ZodString>;
55
58
  call_purpose: z.ZodOptional<z.ZodString>;
56
- user_frustration: z.ZodOptional<z.ZodString>;
57
59
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
58
60
  user_intent: z.ZodOptional<z.ZodString>;
59
61
  call_purpose: z.ZodOptional<z.ZodString>;
60
- user_frustration: z.ZodOptional<z.ZodString>;
61
62
  }, z.ZodTypeAny, "passthrough">>>;
62
63
  }, any, any, {
63
64
  [x: string]: any;