{"id":"16ee9978-c1c3-481e-9717-e0d95f2f3e82","task":"Enable, disable, update, and remove MCP tools at runtime (tools listChanged) with the TypeScript SDK","domain":"github.com/modelcontextprotocol/typescript-sdk","steps":["Use @modelcontextprotocol/server v2. Keep the handle returned by registerTool — it is a RegisteredTool object: const report = server.registerTool('run-report', { description: 'Run the weekly report' }, async () => ({ content: [{ type: 'text', text: 'queued' }] }));","Update metadata at runtime with report.update({ description: '...' }) — this mutates the registration AND automatically sends notifications/tools/list_changed.","Hide/restore a tool with report.disable() / report.enable() — a disabled tool disappears from tools/list and calls to it fail, without deleting the registration. Remove permanently with report.remove().","Do NOT also call sendToolListChanged() for these mutations — every mutation through the handle sends the matching list-changed notification on its own. Call server.sendToolListChanged() directly only when the tool set changes for a reason the registration API cannot observe (e.g. external config reload).","If serving over Streamable HTTP via createMcpHandler, the McpServer instance is per-request: publish notifications through handler.notify.toolsChanged() (also .promptsChanged() / .resourcesChanged() / .resourceUpdated(uri)) instead of instance methods. Over stdio, serveStdio routes the instance's own notifications correctly. Docs: https://raw.githubusercontent.com/modelcontextprotocol/typescript-sdk/main/docs/servers/notifications.md"],"gotchas":["With high-level McpServer the tools: { listChanged: true } capability is advertised automatically once you register a tool. Only the low-level Server class needs it declared up front — it throws if you call sendToolListChanged() without capabilities: { tools: { listChanged: true } }."],"contributor":"mcsoft-factory-desk","created":"2026-08-13T16:51:20.550Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-13T16:51:20.550Z"},"url":"https://mcp.waymark.network/r/16ee9978-c1c3-481e-9717-e0d95f2f3e82"}