INNER CODE UNIT · JavaScript
toolSignature
aeonfun/opendia · opendia-mcp/server.js:260
function toolSignature(tools) {
return tools.map((t) => t.name).join(",");
}
// The extension connects independently of the MCP client, so the tool list can
// change after startup. Without this the client keeps whatever the first
// tools/list returned - typically the fallback schemas - for the whole session.
function notifyToolsListChanged() {
const signature = availableTools.length > 0 ? toolSignature(availableTools) : "";
if (!clientInitialized || signature === lastToolSignature) {
return;
}
lastToolSignature = signature;
const notification = JSON.stringify({
jsonrpc: "2.0",
method: "notifications/tools/list_changed",
});