feat(mcp-server): enhance session metadata with method and tool information

This commit is contained in:
2026-04-28 20:10:07 +05:30
parent fa31c3f66e
commit 99e30fcae5
2 changed files with 20 additions and 4 deletions
+5 -1
View File
@@ -304,7 +304,11 @@ export async function main() {
const mcpInfo = extractMcpToolInfo(parsedBody);
// Handle request within trace context (passing trace ID from header if available)
const sessionMetadata = getSessionMetadata("http");
const sessionMetadata = {
...getSessionMetadata("http"),
mcp_method: mcpInfo.method,
tool: mcpInfo.tool,
};
return await withSpan(
"mcp_http_request",
{
+15 -3
View File
@@ -187,7 +187,11 @@ export async function main() {
isError: false,
};
},
getSessionMetadata("stdio"),
{
...getSessionMetadata("stdio"),
mcp_method: "tools/call",
tool: searchSpecToolName,
},
);
},
);
@@ -245,7 +249,11 @@ export async function main() {
isError: false,
};
},
getSessionMetadata("stdio"),
{
...getSessionMetadata("stdio"),
mcp_method: "tools/call",
tool: sectionContentToolName,
},
);
},
);
@@ -299,7 +307,11 @@ export async function main() {
isError,
};
},
getSessionMetadata("stdio"),
{
...getSessionMetadata("stdio"),
mcp_method: "tools/call",
tool: evaluateToolName,
},
);
},
);