{"at":"2026-11-23T01:23:53.483Z","dir":"sent","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"didrun-lab","version":"0.1.0"},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T01:23:53.909Z","dir":"received","era":"server_discover","message":{"error":{"code":-32601,"message":"Method not found"},"id":1,"jsonrpc":"2.0"}}
{"at":"2026-11-23T01:23:54.010Z","dir":"sent","era":"initialize","message":{"id":1,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{},"clientInfo":{"name":"didrun-lab","version":"0.1.0"},"protocolVersion":"2025-11-25"}}}
{"at":"2026-11-23T01:23:54.393Z","dir":"received","era":"initialize","message":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"tools":{"listChanged":true}},"protocolVersion":"2025-11-25","serverInfo":{"name":"perfonext-profiler-mcp","version":"0.7.3"}}}}
{"at":"2026-11-23T01:23:54.393Z","dir":"sent","era":"initialize","message":{"jsonrpc":"2.0","method":"notifications/initialized"}}
{"at":"2026-11-23T01:23:54.393Z","dir":"sent","era":"initialize","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{}}}
{"at":"2026-11-23T01:23:54.427Z","dir":"received","era":"initialize","message":{"id":2,"jsonrpc":"2.0","result":{"tools":[{"description":"Parse and load a V8/Chrome CPU profile from disk. Supports both .cpuprofile files and Chrome DevTools Trace JSON exports. Returns a profile ID for use with other tools.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"filePath":{"description":"Absolute or relative path to the .cpuprofile or Chrome trace .json file","type":"string"}},"required":["filePath"],"type":"object"},"name":"load_profile","title":"Load CPU Profile"},{"description":"Returns the top N functions by self-time (CPU time spent directly in the function, not its callees). Use this to find performance bottlenecks.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"limit":{"default":10,"description":"Number of hotspots to return (default: 10)","maximum":100,"minimum":1,"type":"number"},"profileId":{"description":"Profile ID returned by load_profile","type":"string"}},"required":["profileId"],"type":"object"},"name":"get_hotspots","title":"Get Hotspots"},{"description":"Returns detailed timing info for a specific function: self-time, total-time, callers, and callees. Use this to understand why a function is slow.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"contextLines":{"description":"Only used with includeSource: minimum lines of padding around the declaration and hot lines (default: 10)","maximum":50,"minimum":1,"type":"integer"},"functionName":{"description":"Exact function name to look up","type":"string"},"includeSource":{"description":"When true, include annotated source code lines with per-line tick counts (default: false)","type":"boolean"},"profileId":{"description":"Profile ID returned by load_profile","type":"string"}},"required":["profileId","functionName"],"type":"object"},"name":"explain_function","title":"Explain Function"},{"description":"Compare two loaded CPU profiles side-by-side. Shows functions that got slower/faster and new/removed hotspots.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"baseProfileId":{"description":"Profile ID of the baseline (before)","type":"string"},"compareProfileId":{"description":"Profile ID to compare (after)","type":"string"},"limit":{"default":10,"description":"Number of top changes to show","maximum":50,"minimum":1,"type":"number"}},"required":["baseProfileId","compareProfileId"],"type":"object"},"name":"compare_profiles","title":"Compare Profiles"},{"description":"Analyzes the profile and returns structured optimization suggestions for the hottest functions. Detects high fan-in, recursion, dominant callers, V8-specific patterns, always reports CPU self-time cost for expensive functions, and deduplicates functions split across multiple call sites.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"limit":{"default":5,"description":"Number of functions to analyze (default: 5)","maximum":20,"minimum":1,"type":"number"},"profileId":{"description":"Profile ID returned by load_profile","type":"string"}},"required":["profileId"],"type":"object"},"name":"suggest_optimizations","title":"Suggest Optimizations"},{"description":"Returns an overview of a loaded profile: duration, sample count, top-level call tree (filtered to functions >0.1% of total time), and idle time percentage. For large profiles, the call tree is limited to depth 2 and top 20 children per node to keep output manageable. Also lists all loaded profiles if no ID is given.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"profileId":{"description":"Profile ID. If omitted, lists all loaded profiles.","type":"string"},"treeDepth":{"default":2,"description":"Depth of call tree to include (default: 2, max: 5)","maximum":5,"minimum":1,"type":"number"}},"type":"object"},"name":"get_profile_summary","title":"Get Profile Summary"},{"description":"Read the actual source code for a hot function and annotate each line with sampled tick counts from positionTicks. The returned window is sized to cover the function's actual hot lines, not just the area around its declaration; if any ticks still fall outside it, a `warning` field reports how many and suggests a larger contextLines. Only reads files within the project root.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"contextLines":{"description":"Minimum lines of padding around the function declaration and its hot lines (default: 10)","maximum":50,"minimum":1,"type":"integer"},"functionName":{"description":"Exact function name to look up","type":"string"},"profileId":{"description":"Profile ID returned by load_profile","type":"string"}},"required":["profileId","functionName"],"type":"object"},"name":"read_source_context","title":"Read Source Context"},{"description":"Aggregate CPU self-time by npm package. Identifies which third-party dependencies are consuming the most CPU, by parsing node_modules paths from the profile. Useful for deciding which packages to replace, lazy-load, or avoid. Scoped packages (e.g. @babel/core) are handled correctly.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"limit":{"description":"Maximum number of packages to return, sorted by self-time (default: 10)","maximum":100,"minimum":1,"type":"integer"},"profileId":{"description":"Profile ID returned by load_profile","type":"string"}},"required":["profileId"],"type":"object"},"name":"get_package_costs","title":"Get Package Costs"},{"description":"Returns a ready-to-run command and step-by-step recipe for capturing a V8 CPU profile, then loading it with load_profile. Use this when you do not yet have a .cpuprofile file. Choose the scenario that matches how the code runs.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"scenario":{"description":"How the code under test runs. \"next-server\" (default) profiles a Next.js production server; \"script\" profiles a Next.js standalone server.js (or another Node entry).","enum":["next-server","script"],"type":"string"}},"type":"object"},"name":"how_to_collect","title":"How To Collect a CPU Profile"}]}}}
