@proofofprotocol/inscribe-mcp 0.3.7 → 0.3.8
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/server.js +13 -11
package/package.json
CHANGED
package/src/server.js
CHANGED
|
@@ -161,14 +161,16 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
161
161
|
const startTime = Date.now();
|
|
162
162
|
const requestId = request.id || `req_${Date.now()}`;
|
|
163
163
|
|
|
164
|
-
// Debug: Agent → MCP (request received) -
|
|
164
|
+
// Debug: Agent → MCP (request received) - sequence diagram style
|
|
165
|
+
// 往路: Agent → MCP → Chain (all →OUT)
|
|
166
|
+
// 復路: Chain → MCP → Agent (all ←IN)
|
|
165
167
|
debugLog('agent_to_mcp', {
|
|
166
168
|
tool: name,
|
|
167
169
|
method: 'tools/call',
|
|
168
170
|
requestId,
|
|
169
171
|
argsKeys: args ? Object.keys(args) : [],
|
|
170
172
|
argsPreview: args ? JSON.stringify(args).slice(0, 100) : null,
|
|
171
|
-
direction: '
|
|
173
|
+
direction: 'OUT' // 往路: →
|
|
172
174
|
});
|
|
173
175
|
|
|
174
176
|
const tool = allTools.find(t => t.name === name);
|
|
@@ -208,24 +210,24 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
208
210
|
type: result.type
|
|
209
211
|
} : null;
|
|
210
212
|
|
|
211
|
-
// Debug: Chain → MCP (response)
|
|
213
|
+
// Debug: Chain → MCP (response) - 復路: ←
|
|
212
214
|
debugLog('chain_to_mcp', {
|
|
213
215
|
tool: name,
|
|
214
216
|
requestId,
|
|
215
217
|
status: 'SUCCESS',
|
|
216
218
|
duration,
|
|
217
219
|
resultPreview,
|
|
218
|
-
direction: 'IN'
|
|
220
|
+
direction: 'IN' // 復路: ←
|
|
219
221
|
});
|
|
220
222
|
|
|
221
|
-
// Debug: MCP → Agent (returning result)
|
|
223
|
+
// Debug: MCP → Agent (returning result) - 復路: ←
|
|
222
224
|
debugLog('mcp_to_agent', {
|
|
223
225
|
tool: name,
|
|
224
226
|
requestId,
|
|
225
227
|
status: 'SUCCESS',
|
|
226
228
|
duration,
|
|
227
229
|
responseSize: JSON.stringify(result).length,
|
|
228
|
-
direction: '
|
|
230
|
+
direction: 'IN' // 復路: ←
|
|
229
231
|
});
|
|
230
232
|
|
|
231
233
|
return {
|
|
@@ -234,7 +236,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
234
236
|
} catch (error) {
|
|
235
237
|
const duration = Date.now() - startTime;
|
|
236
238
|
|
|
237
|
-
// Debug: Chain → MCP (error)
|
|
239
|
+
// Debug: Chain → MCP (error) - 復路: ←
|
|
238
240
|
debugLog('chain_to_mcp', {
|
|
239
241
|
tool: name,
|
|
240
242
|
requestId,
|
|
@@ -242,17 +244,17 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
242
244
|
duration,
|
|
243
245
|
error: error.message,
|
|
244
246
|
errorType: error.constructor.name,
|
|
245
|
-
direction: 'IN'
|
|
247
|
+
direction: 'IN' // 復路: ←
|
|
246
248
|
});
|
|
247
249
|
|
|
248
|
-
// Debug: MCP → Agent (returning error)
|
|
250
|
+
// Debug: MCP → Agent (returning error) - 復路: ←
|
|
249
251
|
debugLog('mcp_to_agent', {
|
|
250
252
|
tool: name,
|
|
251
253
|
requestId,
|
|
252
254
|
status: 'ERROR',
|
|
253
255
|
duration,
|
|
254
256
|
error: error.message,
|
|
255
|
-
direction: '
|
|
257
|
+
direction: 'IN' // 復路: ←
|
|
256
258
|
});
|
|
257
259
|
|
|
258
260
|
return {
|
|
@@ -274,7 +276,7 @@ async function main() {
|
|
|
274
276
|
if (isDebugEnabled()) {
|
|
275
277
|
console.error('Debug mode is currently ON (hot-reloadable)');
|
|
276
278
|
debugLog('server_start', {
|
|
277
|
-
version: '0.3.
|
|
279
|
+
version: '0.3.8',
|
|
278
280
|
tools: allTools.map(t => t.name)
|
|
279
281
|
});
|
|
280
282
|
}
|