@reproapp/mcp 0.0.8 → 0.0.9
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/package.json +1 -1
- package/src/index.js +37 -1
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -16,6 +16,8 @@ const SERVER_INSTRUCTIONS = [
|
|
|
16
16
|
'For Repro-scoped questions about sessions, requests, traces, privacy policies, apps, or configuration, use the Repro MCP tools only.',
|
|
17
17
|
'Do not create local scripts, read cached Repro auth files, or call Repro HTTP APIs directly for Repro data or policy workflows.',
|
|
18
18
|
'For privacy policy writes, inspect first and then use exact statementSid(s) or blockerSetId. Broad natural-language policy update queries are read-only.',
|
|
19
|
+
'For factual debugging questions, use exact evidence tools first and answer from their structured output. Use investigate only after exact evidence is gathered, or when the user explicitly asks for synthesis/root cause.',
|
|
20
|
+
'Never answer that captured client data is absent because code appears to omit it. Verify with request, DB, trace, function-call, and message payload tools, then say exactly what Repro captured or did not capture.',
|
|
19
21
|
].join(' ');
|
|
20
22
|
const DEFAULT_REPRO_AI_BASE_URL = 'https://repro-ai-u8lhw.ondigitalocean.app';
|
|
21
23
|
const DEFAULT_REPRO_API_BASE_URL = 'https://repro-api-d7288.ondigitalocean.app/api';
|
|
@@ -193,6 +195,31 @@ const LOCAL_TOOL_DEFINITIONS = [
|
|
|
193
195
|
},
|
|
194
196
|
];
|
|
195
197
|
|
|
198
|
+
const TOOL_DESCRIPTION_OVERRIDES = {
|
|
199
|
+
investigate:
|
|
200
|
+
'Synthesize a root-cause hypothesis from Repro evidence after exact telemetry tools have been checked. Do not use this as the first or only tool for factual inventory questions about requests, DB changes, traces, function args/returns, emails, Kafka/RabbitMQ/messages, or payload contents; call the exact evidence tool first and cite that output.',
|
|
201
|
+
list_requests:
|
|
202
|
+
'Exact evidence tool: list captured HTTP and backend transport requests in scope. Use this before investigate whenever the user asks what request happened, which endpoint ran, request timing/status, or which request RID anchors later DB/trace/message evidence.',
|
|
203
|
+
get_request:
|
|
204
|
+
'Exact evidence tool: fetch one captured request by RID, including request/response bodies and captured value refs when present. Use this before answering factual questions about a specific request payload, response, endpoint, or transport message wrapper.',
|
|
205
|
+
get_requests_relative_to_anchor:
|
|
206
|
+
'Exact evidence tool: list captured requests before or after an action/request/DB anchor. Use for ordering questions and localizing the request sequence around a UI action or backend event.',
|
|
207
|
+
get_db_changes:
|
|
208
|
+
'Exact evidence tool: fetch captured DB/Redis changes. Use this before answering what collections, documents, fields, queries, mutations, or result metadata changed. Set includeQueryDetails when the user needs query/update/body details.',
|
|
209
|
+
get_trace:
|
|
210
|
+
'Exact evidence tool: fetch captured trace batches for a request RID. Use this before answering which functions ran, trace timing, thrown errors, or trace event details for a request.',
|
|
211
|
+
get_action_path:
|
|
212
|
+
'Exact evidence tool: fetch the correlated action path with requests, DB changes, and emails/messages when available. Use this to connect a UI action to backend evidence before giving a narrative answer.',
|
|
213
|
+
get_function_candidates:
|
|
214
|
+
'Exact evidence tool: find likely captured functions for an action/request/function search. Use this before get_function_calls when the exact function anchor is unclear.',
|
|
215
|
+
get_function_calls:
|
|
216
|
+
'Exact evidence tool: fetch concrete captured function calls, arguments, return values, errors, and value refs. Use this before answering what function handled something or what args/returns were captured.',
|
|
217
|
+
get_kafka_messages:
|
|
218
|
+
'Exact evidence tool: fetch captured Kafka publish/consume payloads. Use this for messaging questions and payload contents; for exact single-message lookups, the MCP server expands captured large values automatically.',
|
|
219
|
+
get_captured_value:
|
|
220
|
+
'Exact evidence tool: fetch the full masked value behind a captured valueId. Use this whenever another tool reports a captured value reference or large_value_available before claiming the payload is unavailable.',
|
|
221
|
+
};
|
|
222
|
+
|
|
196
223
|
function loadConfig(env = process.env) {
|
|
197
224
|
const baseUrl = normalizeBaseUrl(env.REPRO_AI_BASE_URL || DEFAULT_REPRO_AI_BASE_URL);
|
|
198
225
|
const apiBaseUrl = normalizeOptionalBaseUrl(env.REPRO_API_BASE_URL, DEFAULT_REPRO_API_BASE_URL);
|
|
@@ -1141,11 +1168,20 @@ async function handleRpcMessage(message, config, client, getTools) {
|
|
|
1141
1168
|
function publicToolDefinition(tool) {
|
|
1142
1169
|
return {
|
|
1143
1170
|
name: tool.name,
|
|
1144
|
-
description: tool
|
|
1171
|
+
description: publicToolDescription(tool),
|
|
1145
1172
|
inputSchema: tool.inputSchema,
|
|
1146
1173
|
};
|
|
1147
1174
|
}
|
|
1148
1175
|
|
|
1176
|
+
function publicToolDescription(tool) {
|
|
1177
|
+
const base = typeof tool?.description === 'string' ? tool.description.trim() : '';
|
|
1178
|
+
const override = TOOL_DESCRIPTION_OVERRIDES[tool?.name];
|
|
1179
|
+
if (!override) {
|
|
1180
|
+
return base;
|
|
1181
|
+
}
|
|
1182
|
+
return base ? `${override} ${base}` : override;
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1149
1185
|
function normalizeToolCatalog(catalog) {
|
|
1150
1186
|
if (!catalog || typeof catalog !== 'object' || !Array.isArray(catalog.tools)) {
|
|
1151
1187
|
throw new Error('repro-ai returned an invalid tool catalog');
|